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
{{ message }}
Add DeserializationFeature.USE_NULL_FOR_MISSING_REFERENCE_VALUES for selecting null vs "empty/absent" value when deserializing missing Optional value #5350
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.
changed the title [-]Add `DeserializationFeature` for selecting `null` or "empty" value for missing `Optional` value[/-][+]Add `DeserializationFeature` for selecting `null` or "empty" value when deserializing missing `Optional` value[/+]on Oct 16, 2025
changed the title [-]Add `DeserializationFeature` for selecting `null` or "empty" value when deserializing missing `Optional` value[/-][+]Add `DeserializationFeature.USE_NULL_FOR_MISSING_REFERENCE_VALUES` for selecting `null` vs "empty/absent" value when deserializing missing `Optional` value[/+]on Oct 26, 2025
Activity
[-]Add `DeserializationFeature` for selecting `null` or "empty" value for missing `Optional` value[/-][+]Add `DeserializationFeature` for selecting `null` or "empty" value when deserializing missing `Optional` value[/+]M-PRANAY commentedon Oct 18, 2025
Could I work on this?If Yes I will paste a skeleton and continue, please reply @cowtowncoder
cowtowncoder commentedon Oct 19, 2025
@M-PRANAY thank you -- I appreciate the offer -- but I think this is something I need to handle myself.
[-]Add `DeserializationFeature` for selecting `null` or "empty" value when deserializing missing `Optional` value[/-][+]Add `DeserializationFeature.USE_NULL_FOR_MISSING_REFERENCE_VALUES` for selecting `null` vs "empty/absent" value when deserializing missing `Optional` value[/+]Fix #5350: add `DeserializationFeature.USE_NULL_FOR_MISSING_REFERENCE…
Fix FasterXML#5350: add `DeserializationFeature.USE_NULL_FOR_MISSING_…