(note: follow-up to #3601, #5335)
As of 3.0.1, handling of "reference types" (java.util.concurrent.atomic.AtomicReference, java.util.Optional) is inconsistent: in case of "missing" (absent) value from incoming JSON, when passed via Constructor:
AtomicReference is mapped to null (same as in 2.x and 3.0.0)
Optional is mapped to Optional.empty() (same as in 2.x stand-alone module default)
but neither behavior is configurable. (also note that this mapping only matters for Creator-passed properties, including Records -- for Field/Setter settable, absent/missing value is never set).
Let's add a new DeserializationFeature to allow configuring this behavior.
(note: follow-up to #3601, #5335)
As of 3.0.1, handling of "reference types" (
java.util.concurrent.atomic.AtomicReference,java.util.Optional) is inconsistent: in case of "missing" (absent) value from incoming JSON, when passed via Constructor:AtomicReferenceis mapped tonull(same as in 2.x and 3.0.0)Optionalis mapped toOptional.empty()(same as in 2.x stand-alone module default)but neither behavior is configurable. (also note that this mapping only matters for Creator-passed properties, including Records -- for Field/Setter settable, absent/missing value is never set).
Let's add a new
DeserializationFeatureto allow configuring this behavior.