-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add MapperFeature.REQUIRE_HANDLERS_FOR_JAVA8_OPTIONALS
to prevent failure of java.util.Optional
(de)serialization without Java 8 module
#5006
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
Comments
MapperFeature
to prevent failure of java.util.Optional
(de)serialization without Java 8 moduleMapperFeature.REQUIRE_HANDLERS_FOR_JAVA8_OPTIONALS
to prevent failure of java.util.Optional
(de)serialization without Java 8 module
HI - |
@seadbrane I don't know what would be different there -- new setting simply prevents failure, affecting no other handling. Possibly some other changes, unrelated to this issue -- Property discovery rewrite of 2.18 -- ? |
Is there a simpler way to write a deserializer that still supports the old behavior than the following? My main concern is whether this covers all use cases, especially since I had to add custom logic to handle collection types.
|
(note: follow-up to #4499)
So: looks like #4082 has caused many problems and although direction is clear wrt canonical (de)serialization of
Optional
s (basically what https://github.com/FasterXML/jackson-modules-java8/ adds), it seems reasonably to add aMapperFeature
that basically disables checks #4082 adds.What this means is that when the new
MapperFeature
(Name To Be Decided) is changed:java.util.Optional
handling proceeds the way it would with no checks -- specifically, it is fine if default Bean-style handling occursjava.util.Optional
handlersIt may seem odd to add a "feature to disable another newish feature", but this seems minimal path that achieves goals of #4082 while still allowing backwards-compatibility for users that depended on old handling (esp. with explicit visibility changes).
The text was updated successfully, but these errors were encountered: