(note: see FasterXML/jackson-modules-java8#251 for background with Jackson 2.x)
So, other "reference type" deserializers handle things so that:
- explicit
null token becomes "empty" reference (like new AtomicReference<>(null) or Optional.empty())
- absent (missing) value becomes Java
null
but currently for Optional (2) is not true: instead, it behaves same as explicit null value from JSON.
This is problematic as it is not possible to distinguish "absent" case from explicit null.
We can change behavior for Jackson 3.0.
(note: see FasterXML/jackson-modules-java8#251 for background with Jackson 2.x)
So, other "reference type" deserializers handle things so that:
nulltoken becomes "empty" reference (likenew AtomicReference<>(null)orOptional.empty())nullbut currently for
Optional(2) is not true: instead, it behaves same as explicitnullvalue from JSON.This is problematic as it is not possible to distinguish "absent" case from explicit
null.We can change behavior for Jackson 3.0.