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
Integrate Jackson @JsonView [SPR-7156] #11815
Comments
Arjen Poutsma commented Moved to SPR. |
Arjen Poutsma commented I am not completely sure what you mean, but I believe you can use the ResponseBody class to accomplish this. |
Robert Pond commented You can use JsonViews to determine what properties of a bean to include in the Json reponse. I think you can already accomplish this with the renderedAttributes property of the MappingJacksonJsonView though. |
marc schipperheyn commented
|
Filip Spiridonov commented Here is an example and the spring black magic workaround: |
Alex commented Here you can find an implementation that can be a starting point: https://github.com/martypitt/JsonViewExample |
Elnur Abdurrakhimov commented I want and need this badly. Any neat solutions yet? |
Gunnar Hillert commented This is maybe not the perfect Jira - but for XD-999 it would have been nice to "fine-tune" Jackson serialization on a per-controller basis. We had to add a Jackson MixIn, but only needed that for one controller to suppress serialization for one property. The problem is that when doing it on a more global level you may introduce unnecessary project dependencies for other sub-projects. |
Willie Wheeler commented +1 I have a RESTful web service that exposes collection resources (e.g., /data-centers) and single resources (e.g., /data-centers/chandler). The collection resource endpoints present a more summary view of the data, whereas the single resource endpoints are more detailed. For the collection resource endpoints, I want to use So the JSON view varies from endpoint to endpoint, and it would be useful to have a clean way to communicate this to the ObjectMapper. |
Rossen Stoyanchev commented We have an initial proposal ready that provides support for Jackson's If anyone is interested please try it out with Either way comments welcome! |
Rossen Stoyanchev commented Marking resolved for now but feel free to comment. |
Marcel Overdijk commented Any chance to backport this to 4.0.x? |
Sébastien Deleuze commented Current 4.0.x status is that only critical fixes can be integrated in order to avoid regressions, so it will be only available starting 4.1.x. |
Benjamin Conlan commented Is there a way to have this play nicely with the |
Brandon Whiteman opened SPR-7156 and commented
Jackson's JSONView annotation allows the developer to control which aspects of a method are serialiazed. With the current implementation, the Jackson view writer must be used but then the content type is not available. It would be better if as part of the RequestBody annotation, a JSONView could be specified.
Affects: 3.1.2
Issue Links:
@ResponseBody
@JsonView
deserialization support for request bodies@JsonView
to be used on meta-annotations on Rest methodsReferenced from: commits 51fc3b4, be0b69c
25 votes, 24 watchers
The text was updated successfully, but these errors were encountered: