-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add support for @JsonMerge
to allow "deep update"
#1399
Comments
Initial implementation now exists, supporting POJOs, |
Any docs on how to test this? |
@heruan at this point the best way I think is to search for unit tests with |
@JsonSetter(merge=OptBoolean.TRUE
) to allow "deep update" @JsonMerge
to allow "deep update"
Wouldn't it be nice to have an option to enable setting null values at merge path ? Ref #1437 // Also: nulls better not override
public void testBeanMergingWithNull() throws Exception
{
Config config = MAPPER.readerForUpdating(new Config(5, 7))
.readValue(aposToQuotes("{'loc':null}"));
assertNotNull(config.loc);
assertEquals(5, config.loc.a);
assertEquals(7, config.loc.b);
} What if I really want to be able to set null for loc ? assertNull(config.loc); Thanks for your reply. |
@Tetradeus Please file a new issue; this one is closed. We can discuss details as part of that. |
Currently existing values of properties are not taken into consideration, with the rare case of "setterless-getters" where this is done for
Collection
types if no setter exists.But it would be useful to allow this for
Map
s and POJOs as well.Proposed mechanism is to allow use of:
In addition to per-property annotation, it should also be possible to specify "config overrides" using:
which would specify default merge/no-merge settings for properties of specified type.
It would probably also make sense to allow setting fully global default, similar to ability to set "serializationInclusion" global defaults (with
JsonInclude.Value
).The text was updated successfully, but these errors were encountered: