-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Json.parse fails for strings > 5000000 in length #1054
Comments
Will take a look at this in the course of upgrading jackson. |
@RiteshBM Play does not support Jackson 2.15 or above. Jackson 2.15 introduced StreamReadConstraints and Play has not yet implemented anything to allow users with very large JSON docs to override the default Jackson settings. Stick with Jackson 2.14. |
@pjfanning Does it mean I can't use Play without bypassing this limit if other packages require jackson > 2.14. |
Try calling this method to override the StreamReadConstraints. |
Play JSON Version (2.5.x / etc)
2.9.4
API (Scala / Java / Neither / Both)
Scala
Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)
MacOS 14.3 M1
JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)
Amazon Cornetto Java 17.0.7
Library Dependencies
com.fasterxml.jackson.core:jackson-databind "2.15.0"
com.fasterxml.jackson.core:jackson-core "2.15.0"
com.fasterxml.jackson.core:jackson-annotations "2.15.0"
com.fasterxml.jackson.module:jackson-module-scala_2.12 "2.15.0"
Expected Behavior
Actual Behavior
throws an exception:
com.fasterxml.jackson.core.exc.StreamConstraintsException: String length (5043551) exceeds the maximum length (5000000)
Jackson version: 2.15.0
Reproducible Test Case
val largeString = "a" * 20 * 1000000
val largeJsonString = s"""{ "key": "$largeString" }"""
Related Issues
FasterXML/jackson-core#1001
I've used Json.parse in multiple places. I think Play doesn't expose a way to configure this limit globally. Will I have to create a custom ObjectMapper everywhere ?
The text was updated successfully, but these errors were encountered: