Support @JsonFilter on @ResponseBody and ResponseEntity Controller methods [SPR-15164] #19730
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: duplicate
A duplicate of another issue
type: enhancement
A general enhancement
Uh oh!
There was an error while loading. Please reload this page.
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:
@JsonFilter
("duplicates")The text was updated successfully, but these errors were encountered: