@JsonAnyGetter
does not respect view settings if there is an active view set
#2289
Labels
3.x
Issues to be only tackled for Jackson 3.x, not 2.x
For the following setup:
I would expect properties contained by the map annotated with
@JsonAnyGetter
not to be included in the serialized form if serialization is done with an active view ofA.class
. The generated JSON object should contain onlyname
property.In version
2.9.8
it does not work this way. Properties from the@JsonAnyGetter
map seem to be included unconditionally. The behavior is the same if the@JsonView
annotation is removed from the method andDEFAULT_VIEW_INCLUSION
is disabled.Is it like this by design or can it be considered a bug or a missing feature 😉 ?
If it's the second case I would like to request such a fix/feature as I think covering
@JsonAnyGetter
by view handling would be much more intuitive.I guess the settings should likewise be honored on deserialization (
@JsonAnySetter
) if it is done with an active view.The text was updated successfully, but these errors were encountered: