Closed patryk-beekeeper closed 1 year ago
Since Optional
handling provided by Java 8 module, transferring there.
This is a limitation -- only Creator-passed values can detect absence of value; for fields and setters nothing is done if no input is found. So the behavior is different but that is not considered a bug nor can be easily fixed.
There may be an issue for jackson-databind
to support handling of "absent" values for Fields and Methods (there is one for enforcing "required"-ness, and if that was done, "absent" aspect could also be supported.
Closing here, however, since this is not really specific to Optional
nor can be solved here.
Describe the bug I have a use case when lack of field in json has different meaning than setting this field to null. To model this I use Optional<>. It works fine without @JsonCreator, but do not work with @JsonCreator
Version information 2.12.4
To Reproduce
Expected behavior The behaviour for both classes should be the same and test should pass.