Skip to content
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

Offer a way to directly set StreamReadConstraints via JsonFactory (not just Builder) #962

Closed
cowtowncoder opened this issue Mar 22, 2023 · 3 comments · Fixed by #964
Closed
Labels
2.15 Issue planned (at earliest) for 2.15

Comments

@cowtowncoder
Copy link
Member

Although Builder-style configuration is becoming preferred for Jackson in 2.x (and the only way in 3.0), there is need to support mutable configuration for some key configuration. While for any truly new, optional functionality Builder-style may be sufficient, processing limits change existing behavior so they must be available via "legacy" style configuration too. This is in particular important for frameworks that do not fully control configurability but expose it to their users; and expecting users to change interfaces/mechanisms for ObjectMapper/JsonFactory configuration is a big ask (not to mention compatibility nightmare).

So, before 2.15.0 final, let's ensure StreamReadConstraints can be set on JsonFactory: it can not (alas!) be immutable until 3.0.

@cowtowncoder cowtowncoder added the 2.15 Issue planned (at earliest) for 2.15 label Mar 22, 2023
@cowtowncoder
Copy link
Member Author

See spring-projects/spring-boot#34709 for context.

@pjfanning
Copy link
Member

So if you have an ObjectMapper instance, you can call getFactory() to gets its JsonFactory (which might have been created by the ObjectMapper constructor - or may have been provided when building the ObjectMapper).

The new API will let you reset the StreamReadConstraints on the JsonFactory instance? This would seem like a reasonable solution.

@cowtowncoder
Copy link
Member Author

@pjfanning Correct. Like the way most configuration worked before starting to add Builder-style.

paolobazzi added a commit to eclipse-scout/scout.rt that referenced this issue Mar 6, 2024
Jackson's object mapper enforces some read/write constraints since
release 2.15. The maximum length for strings was limited to 20mb as
default. Since Scout dataobject mapper may be used with base64-encoded
binary data occasionally, 20mb may not be sufficient for each case.
This fix increases the default limit to 100mb and adds support to
modify all constraints using config properties.

See
eclipse-ee4j/jersey#5283
FasterXML/jackson-core#962
FasterXML/jackson-core#964

376418
paolobazzi added a commit to eclipse-scout/scout.rt that referenced this issue Mar 12, 2024
Jackson's object mapper enforces some read/write constraints since
release 2.15. The maximum length for strings was limited to 20mb as
default. Since Scout dataobject mapper may be used with base64-encoded
binary data occasionally, 20mb may not be sufficient for each case.
This fix increases the default limit to 100mb and adds support to
modify all constraints using config properties.

See
eclipse-ee4j/jersey#5283
FasterXML/jackson-core#962
FasterXML/jackson-core#964

376418
paolobazzi added a commit to eclipse-scout/scout.rt that referenced this issue Mar 12, 2024
Jackson's object mapper enforces some read/write constraints since
release 2.15. The maximum length for strings was limited to 20mb as
default. Since Scout dataobject mapper may be used with base64-encoded
binary data occasionally, 20mb may not be sufficient for each case.
This fix increases the default limit to 100mb and adds support to
modify all constraints using config properties.

See
eclipse-ee4j/jersey#5283
FasterXML/jackson-core#962
FasterXML/jackson-core#964

376418
paolobazzi added a commit to eclipse-scout/scout.rt that referenced this issue Mar 12, 2024
Jackson's object mapper enforces some read/write constraints since
release 2.15. The maximum length for strings was limited to 20mb as
default. Since Scout dataobject mapper may be used with base64-encoded
binary data occasionally, 20mb may not be sufficient for each case.
This fix increases the default limit to 100mb and adds support to
modify all constraints using config properties.

See
eclipse-ee4j/jersey#5283
FasterXML/jackson-core#962
FasterXML/jackson-core#964

376418
paolobazzi added a commit to eclipse-scout/scout.rt that referenced this issue Mar 12, 2024
Jackson's object mapper enforces some read/write constraints since
release 2.15. The maximum length for strings was limited to 20mb as
default. Since Scout dataobject mapper may be used with base64-encoded
binary data occasionally, 20mb may not be sufficient for each case.
This fix increases the default limit to 100mb and adds support to
modify all constraints using config properties.

See
eclipse-ee4j/jersey#5283
FasterXML/jackson-core#962
FasterXML/jackson-core#964

376418
paolobazzi added a commit to eclipse-scout/scout.rt that referenced this issue Mar 14, 2024
Jackson's object mapper enforces some read/write constraints since
release 2.15. The maximum length for strings was limited to 20mb as
default. Since Scout dataobject mapper may be used with base64-encoded
binary data occasionally, 20mb may not be sufficient for each case.
This fix increases the default limit to 100mb and adds support to
modify all constraints using config properties.

See
eclipse-ee4j/jersey#5283
FasterXML/jackson-core#962
FasterXML/jackson-core#964

376418
paolobazzi added a commit to eclipse-scout/scout.rt that referenced this issue Mar 14, 2024
Jackson's object mapper enforces some read/write constraints since
release 2.15. The maximum length for strings was limited to 20mb as
default. Since Scout dataobject mapper may be used with base64-encoded
binary data occasionally, 20mb may not be sufficient for each case.
This fix increases the default limit to 100mb and adds support to
modify all constraints using config properties.

See
eclipse-ee4j/jersey#5283
FasterXML/jackson-core#962
FasterXML/jackson-core#964

376418
paolobazzi added a commit to eclipse-scout/scout.rt that referenced this issue Mar 14, 2024
Jackson's object mapper enforces some read/write constraints since
release 2.15. The maximum length for strings was limited to 20mb as
default. Since Scout dataobject mapper may be used with base64-encoded
binary data occasionally, 20mb may not be sufficient for each case.
This fix increases the default limit to 100mb and adds support to
modify all constraints using config properties.

See
eclipse-ee4j/jersey#5283
FasterXML/jackson-core#962
FasterXML/jackson-core#964

376418
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.15 Issue planned (at earliest) for 2.15
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants