Skip to content

Support @JsonFilter on @ResponseBody and ResponseEntity Controller methods [SPR-15164] #19730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Jan 18, 2017 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jan 18, 2017

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:

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement status: duplicate A duplicate of another issue in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants