Replacement for MapperBuilder.serializationInclusion(JsonInclude.Include.NON_NULL) #5294
Unanswered
runeflobakk
asked this question in
Q&A
Replies: 1 comment 12 replies
-
I would suggest looking at test cases that use that method. https://github.com/search?q=repo%3AFasterXML%2Fjackson-databind%20defaultPropertyInclusion&type=code |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I see that
MapperBuilder.serializationInclusion(JsonInclude.Include.NON_NULL)
was deprecated in 2.20. I use it like this:The javadoc advises to use
MapperBuilder.defaultPropertyInclusion(JsonInclude.Value)
instead, but I am not sure how to obtain an instance ofJsonInclude.Value
equivalent toJsonInclude.Include.NON_NULL
.I see that internally, Jackson does
JsonInclude.Value.construct(incl, incl)
in ObjectMapper, but is that the proper way for user code? Perhaps there is missing adefaultPropertyInclusion(JsonInclude.Include)
overload in MapperBuilder? :)Beta Was this translation helpful? Give feedback.
All reactions