-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
Empty options serialize to null since 2.7.4 #280
Comments
To clarify, this is still broken in 2.8.2. |
Thanks for the clarification; that was going to be my first question! I have limited time, but will see what I can do tonight. |
By default, empty To set default inclusion strategy you would use:
or use Now: I don't think that a chance in patch version was intentional or the right way to do this; such fixes should be done in new minor versions. But going forward it sounds like the new behavior is the way things are supposed to work from Jackson perspective. |
Hmm, |
@ieure For 2.9 I hope to finally add ability to define custom handlers because possible rules users want are unlimited: simplest ones can be enumerated, but there needs to be an extension point to allow even more elaborate checking. FWIW, Hope this helps. |
I also thought this was a bug. Would be great if this new behavior were documented. :-) |
@jsw It is documented in Javadocs for |
I tried to upgrade Jackson in my Scala project today, and was met with several failing tests. I tracked this down to a behavior change from jackson-module-scala 2.7.3 -> 2.7.4. The issue is that empty
Option
s now serialize tonull
. Prior to 2.7.3, they would be omitted from the output JSON.Here's a project with a minimal failing testcase: https://github.com/ieure/jackson-scala-testcase
Based on this being an change in
Option
behavior & starting with 2.7.4, I suspect #252 is related to the breakage.The text was updated successfully, but these errors were encountered: