Skip to content
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

MappingJacksonJsonView.setRenderedAttributes [SPR-6165] #10833

Closed
spring-projects-issues opened this issue Sep 29, 2009 · 2 comments
Closed

MappingJacksonJsonView.setRenderedAttributes [SPR-6165] #10833

spring-projects-issues opened this issue Sep 29, 2009 · 2 comments
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Sep 29, 2009

Ken Egervari opened SPR-6165 and commented

Hi, the setRenderedAttributes() method is pretty much useless. In practice, we want to filter out elements that belong to the tree that are nested... not the top level elements. A common idiom is to a list of domain objects, and only wanting specific properties on each domain object to be marshalled. As appears that this is impossible right now, which makes this method useless.

I checked the test cases in your rc1 distribution... and they are really simple. the guy that tested it just made 1 map and a simple bean that wasn't nested at all. If that's all he tested, I'm going to assume nested properties won't work.

Can you please make this work as nested properties and fix the test cases?

If we have a list of Object X and X has a, b, c properties, we should just say a map of "a" and "c" and it should work. Currently, it does not, and it is a big problem.

And I hate to say it, but setting up a map of strings is kind of bloated. It would be nice to have a list of comma-separated strings as an input as well to cut down on the lines of code it takes to write this.

Thanks


Affects: 3.0 RC1

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

Ken Egervari commented

Also, some logging wouldn't hurt early... so I know what the keys are and what I need to set. As it stands, I have no idea what is supposed to get into the setRenderedAttributes() map for nested elements.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 4, 2014

Sébastien Deleuze commented

For this need consider using the new JsonView mechanism support (#11815).

@spring-projects-issues spring-projects-issues added status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement 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: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant