I've Foo class with some values and use the same Foo oject to deserialize.
public class Foo {
public String name;
public Integer age;
public Goo g;
}
static public class Goo {
public Long id;
public Integer level;
}
assume // String jsonStr = {"name" : "alan"; "g": {"level":6}}
Foo f = new Foo();
f.name = "dummy";
f.age = 99;
//asssume f.g.id = 3
objectMapper.readerForUpdating(f).readValue(jsonStr);
// f object toString
output {"name" : "alan"; "age" : 99, "g":{"id": null, "level":6}}
how to configure such that it wont upate any or default value on the field which have value on the missing field?
like below output instead
output {"name" : "alan"; "age" : 99, "g":{"id": 3, "level":6}}