You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With addition of new JsonInclude.Include option, NON_ABSENT, and existing dualism between POJOs, java.util.Maps, seems like we will also need WRITE_ABSENT_MAP_VALUES.
Its semantics are such that if enabled, it will exclude serialization of both Java nulls AND "referential nulls" (like Optional.absent() and new AtomicReference<>(null)); if disabled, WRITE_NULL_MAP_VALUES is consulted.
Yes, things get bit hairy, and it would be cleaner if instead we could set JsonInclude.Include value instead. But it has to do.
The text was updated successfully, but these errors were encountered:
After trying to implement this, I realized one challenge: while it is relatively straight-forward to work for Map-valued properties, as they typically have proper value type declaration, it will not work quite right for root-Maps where type is generally assumed to be Object.
Given that users are probably going to be surprised by one case working, others not, I will defer implementation for now.
Quick note: with 2.7, there is the new concept of content inclusion (as distinct from older value inclusion) -- that is, related but separated checks for container, its contents -- this may be easier to support. Or possibly even works as is; if latter, needs to be tested to verify that specific combination of inclusion definitions works as expected.
With addition of new
JsonInclude.Include
option,NON_ABSENT
, and existing dualism between POJOs,java.util.Map
s, seems like we will also needWRITE_ABSENT_MAP_VALUES
.Its semantics are such that if enabled, it will exclude serialization of both Java
null
s AND "referential nulls" (likeOptional.absent()
andnew AtomicReference<>(null)
); if disabled,WRITE_NULL_MAP_VALUES
is consulted.Yes, things get bit hairy, and it would be cleaner if instead we could set
JsonInclude.Include
value instead. But it has to do.The text was updated successfully, but these errors were encountered: