Skip to content

Commit

Permalink
Seal JsonParserSetting trait
Browse files Browse the repository at this point in the history
It shouldn't be extended but be used as shown.
  • Loading branch information
jrudolph committed Nov 8, 2018
1 parent 0821642 commit 21a3468
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/main/scala/spray/json/JsonParserSettings.scala
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 21a3468

Please sign in to comment.