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

Make it possible to use @JsonView on method parameters #48

Closed
sdeleuze opened this issue Dec 4, 2014 · 2 comments
Closed

Make it possible to use @JsonView on method parameters #48

sdeleuze opened this issue Dec 4, 2014 · 2 comments
Milestone

Comments

@sdeleuze
Copy link

sdeleuze commented Dec 4, 2014

In order to continue the recent improvements we have done in Spring's Jackson integration, we would like to add support for @JsonView deserialization on request bodies as described in this issue.

The issue we have is that @JsonView only targets ElementType.METHOD and ElementType.FIELD. Would you consider adding ElementType.PARAMETER in order to allow us to support this kind of use case?

@RequestMapping(value = "/persons", consumes = APPLICATION_JSON_VALUE, method = RequestMethod.POST)
public ResponseEntity<Person> savePerson(@JsonView(View.Summary.class) @RequestBody Person p)
{
    return new ResponseEntity<>(personRepository.save(p), HttpStatus.OK);
}
@cowtowncoder
Copy link
Member

That sounds reasonable to me, yes, I can make the change.

@cowtowncoder cowtowncoder added this to the 2.5.0 milestone Dec 4, 2014
@sdeleuze
Copy link
Author

sdeleuze commented Dec 4, 2014

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants