You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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..
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)
The text was updated successfully, but these errors were encountered:
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
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
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)
The text was updated successfully, but these errors were encountered: