Closed
Description
So, for case like:
public class OptionalnBean {
Optional<String> value;
@JsonCreator
public OptionalnBean(@JsonProperty("value") Optional<String> value) {
this.value = value;
}
}
with JSON like
{ }
current handling would assign Optional.empty()
to value
. But other reference types, like AtomicReference
will instead assign null
. This is to differentiate case of reading JSON like:
{ "value" : null }
in which value for all reference types becomes "empty" value (new AtomicReference<>, Optional.empty()).
This should be fixed for 2.14. But since this is a behavioral change it is also necessary to add configurability to allow old behavior, at least for 2.x.
And to maximize backwards compatibility we probably have to default to old and (IMO) sub-optimal handling.
Metadata
Metadata
Assignees
Labels
No labels