Change Optional
deserialization from "absent" value into null
, from "empty"
#3601
Labels
3.x
Issues to be only tackled for Jackson 3.x, not 2.x
(note: see FasterXML/jackson-modules-java8#251 for background with Jackson 2.x)
So, other "reference type" deserializers handle things so that:
null
token becomes "empty" reference (likenew AtomicReference<>(null)
orOptional.empty()
)null
but currently for
Optional
(2) is not true: instead, it behaves same as explicitnull
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.
The text was updated successfully, but these errors were encountered: