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

Possible problem with "NON_EMPTY" rule for primitive values #244

Closed
crumbpicker opened this issue Mar 31, 2016 · 2 comments
Closed

Possible problem with "NON_EMPTY" rule for primitive values #244

crumbpicker opened this issue Mar 31, 2016 · 2 comments

Comments

@crumbpicker
Copy link

After switching to the Jackson Module 2.7.2 I have the same issue than this one:
FasterXML/jackson-databind#849

The symptom is that primitive fields equals to zero are not exported in the JSON string when including NON_EMPTY fields.

The problem seems to be solved in Jackson core. Is there a compatibility issue with the module ?

@crumbpicker
Copy link
Author

Sorry about this. This was a mistake in my POM.
I was erasing the appropriate version of the module by an older one.

@cowtowncoder
Copy link
Member

@crumbpicker Right, this sounds very much like 2.6 behavior, and something that has caused lots of grief. Behavior in 2.7 same as 2.5 and before: default values like 0 for int may now be excluded by using NON_DEFAULT, and NON_EMPTY is strictly reserved for things with "more natural" concept of emptiness (Strings, arrays/Collections/Maps, referential types like Optional).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants