-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Milestone
Description
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:
public class POJO {
@JsonSetter(merge=OptBoolean.TRUE)
public List<String> names = new ArrayList<>();
{
names.add("first");
}
In addition to per-property annotation, it should also be possible to specify "config overrides" using:
objectMapper.configOverrides(MyPOJO.class)
.setter(JsonSetter.Value.from(.....));
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
).
fromi, reinaldo-besen, GisMarsch, don-han and vkumaev
Metadata
Metadata
Assignees
Labels
No labels