Skip to content

@RequestBody required parameter is ignored allowing null payloads [SPR-13490] #18068

Closed
@spring-projects-issues

Description

@spring-projects-issues

Emanuel Hategan opened SPR-13490 and commented

When handling a POST request in a @RestController, the payload parameter annotated with @RequestBody can be null, regardless of the value of the required attribute.

Payload is JSON (content-type header is included) and deserialization is handled by Jackson.

In case it matters, the project is inheriting from spring-boot-starter-parent version 1.2.5.RELEASE.


Affects: 4.1.7

Reference URL: http://stackoverflow.com/questions/32222099/spring-4-reject-null-requestbody-for-all-endpoints

Issue Links:

Referenced from: commits spring-attic/spring-framework-issues@5bf23a0, spring-attic/spring-framework-issues@c93c892, spring-attic/spring-framework-issues@0319caf

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions