summaryrefslogtreecommitdiff
path: root/src/main/scala/spray/json/JsonParserSettings.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/spray/json/JsonParserSettings.scala')
-rw-r--r--src/main/scala/spray/json/JsonParserSettings.scala18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/main/scala/spray/json/JsonParserSettings.scala b/src/main/scala/spray/json/JsonParserSettings.scala
index b82c47d..8c76b0a 100644
--- a/src/main/scala/spray/json/JsonParserSettings.scala
+++ b/src/main/scala/spray/json/JsonParserSettings.scala
@@ -1,6 +1,22 @@
package spray.json
-trait JsonParserSettings {
+/**
+ * Allows to customize settings for the JSON parser.
+ *
+ * Use it like this:
+ *
+ * ```
+ * val customSettings =
+ * JsonParserSettings.default
+ * .withMaxDepth(100)
+ * .withMaxNumberCharacters(20)
+ *
+ * JsonParser(jsonString, customSettings)
+ * // or
+ * jsonString.parseJson(customSettings)
+ * ```
+ */
+sealed trait JsonParserSettings {
/**
* The JsonParser uses recursive decent parsing that keeps intermediate values on the stack. To prevent
* StackOverflowExceptions a limit is enforced on the depth of the parsed JSON structure.