-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
most-wantedTag to indicate that there is heavy user +1'ing actionTag to indicate that there is heavy user +1'ing action
Milestone
Description
(note: replaces #1269, earlier #988 and #830)
It looks like there is strong desire to define alternate methods for handling incoming null values; instead of just assigning as Java nulls to:
- Ignore value (avoid calling setter)
- Fail (throw exception)
- Convert to a default value
Since applicability is probably not universal for all cases (that is, different types could well follow different rules), it seems that approach similar to @JsonInclude would work.
However, I don't think use of @JsonInclude itself works here, as its settings are partially output-specific; so ideas are reusable, implementation not.
Instead, I think use of existing @JsonSetter by adding:
Nullsvalue enumeration for a small set of standard behaviors (and perhaps, in future, for custom handler?)nullsproperty for dealing with value itself (POJO, Collection, wrapper type)contentNullsfor contents of structured types: array/collection elements, Map values, POJO properties
Changes to annotation are simple; changes to deserializers would be sizable.
reinaldo-besen, tadhgpearson, aldobrucale, raindev, jukmanty and 9 more
Metadata
Metadata
Assignees
Labels
most-wantedTag to indicate that there is heavy user +1'ing actionTag to indicate that there is heavy user +1'ing action