Closed
Description
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:
- Avoid reading (empty) RequestBody for HTTP methods that aren't expected to have a body [SPR-13176] #17768 Avoid reading (empty) RequestBody for HTTP methods that aren't expected to have a body ("duplicates")
Referenced from: commits spring-attic/spring-framework-issues@5bf23a0, spring-attic/spring-framework-issues@c93c892, spring-attic/spring-framework-issues@0319caf