Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonValue.NULL deserialization has different behaviours with constructor properties vs public properties #19

Closed
xdrsynapse opened this issue Mar 4, 2022 · 1 comment
Labels
2.14 Intended for version 2.14.x jsr-353 Issue related to JSR-353/JSONP datatype module
Milestone

Comments

@xdrsynapse
Copy link
Contributor

Describe the bug
Deserializing a missing property to JsonValue while using constructor properties should set java null instead JsonValue.null, this when deserializing to class with public properties works wel..

Version information
2.13.1

To Reproduce
JsonValueTest.txt

Expected behavior
When missing property map to java null and when property is null map to JsonValue.NULL.

Additional context
We are using this to know when we when we should do nothing (java null) and when we must set the value to null in database (JsonValue.NULL)

@xdrsynapse xdrsynapse changed the title JsonValue.NULL deserialization different behaviours with constructor properties vs public properties JsonValue.NULL deserialization has different behaviours with constructor properties vs public properties Mar 4, 2022
@cowtowncoder cowtowncoder transferred this issue from FasterXML/jackson-databind Mar 4, 2022
@cowtowncoder cowtowncoder added jsr-353 Issue related to JSR-353/JSONP datatype module 2.14 Intended for version 2.14.x and removed to-evaluate labels Mar 4, 2022
@cowtowncoder
Copy link
Member

Should be doable technically but has backwards-compatibility concerns; hence needs to go in 2.14(.0).

I may not have time on short-term to work on this but would be happy to collaborate if anyone had time to propose a PR.

Method that is relevant here is JsonDeserializer.getAbsentValue(DeserializationContext) (added in 2.13) which differs from older JsonDeserializer.getNullValue() to specifically address this case.
So I think this just needs to be added for relevant deserializer; and obviously add test cases to check for handling.

xdrsynapse added a commit to xdrsynapse/jackson-datatypes-misc that referenced this issue Mar 6, 2022
cowtowncoder pushed a commit that referenced this issue Mar 9, 2022
@cowtowncoder cowtowncoder added this to the 2.14.0 milestone Mar 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.14 Intended for version 2.14.x jsr-353 Issue related to JSR-353/JSONP datatype module
Projects
None yet
Development

No branches or pull requests

2 participants