Skip to content

Jackson @JsonView deserialization support for request bodies [SPR-12501] #17106

Closed
@spring-projects-issues

Description

@spring-projects-issues

Ersin Er opened SPR-12501 and commented

#11815 added support for @JsonView for response bodies. The same can also be applied to request bodies as Jackson already supports @JsonView for deserialization.

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

Affects: 4.1.2

Attachments:

Issue Links:

4 votes, 9 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions