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
Toying with an alternate idea of combining this with @JsonSetter(nulls=Nulls.SET) (vs Nulls.SKIP).
On one hand, that setting already exists, and would work well for per-property annotations.
But on the other hand might be bit messy for defaulting (per-type, globals); and needs of merging may be different from use for straight "regular" deserialization.
Actually going with @JsonSetter route makes tons of sense because that is fully wired already, and conversely trying to use different settings for merge/non-merge case would be a major PITA.
So: changes I will make are:
Default for merge for nulls is same as regular deserialization setting: that is, just set it as null (or replacement null value as case may be)
To skip nulls during merging, JsonSetter.Value must be used at one of 3 levels (property annotation, per value-type annotation, global defaults) -- Nulls.SKIP will achieve this.
And with that it will be possible to make nulls overwrite non-null values.
Version : 2.9 r2
Related to #1399 and #1437
Wouldn't it be nice to have an option to enable setting null values at merge pathes ? Ref #1437
Presently in tests about Json merge :
What if I really want to be able to set null for loc ? assertNull(config.loc);
Not totally sure, but this would make it Json Merge Patch compatible.
The text was updated successfully, but these errors were encountered: