Skip to content

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

@sdeleuze

Description

@sdeleuze

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions