Closed
Description
doom777 opened SPR-15164 and commented
Just like @JsonView
can be used to properly serialize response entities, so should @JsonFilter
.
Unfortunately, sometimes @JsonView
is not flexible enough. In my app, for example, a response body contains two arrays: objects to add to display, and objects to remove from display. Both Arrays are of the same Type, however objects to add are full objects with all of entities, while objects to remove are just light shells, not fully retrieved from the database for performance issues. They are of same type, but need different serialization. I'd like to register a custom serialization filter with my app-wide object mapper, and use it on the return value from my controller method.
Issue Links:
- Support Jackson @JsonFilter [SPR-12586] #17187 Support Jackson
@JsonFilter
("duplicates")