Michel Zanini opened SPR-9239 and commented
@RequestBody should have a required parameter to allow a request body to be optional, if the body is empty my object is null, otherwise it is parsed using a http message converter.
At the moment I am using a Jackson (JSON) converter and if I use it as bellow:
@RequestMapping(method = RequestMethod.POST, value = "/url")
public String method(@RequestBody MyBody myBody) {
...
}
Then, if I send an empty body it will throw an java.io.EOFException.
In this case I would like to receive null in myBody and execute my method anyway.
This issue maybe related to https://jira.springsource.org/browse/SPR-9238.
Affects: 3.1.1
Issue Links:
Referenced from: commits spring-attic/spring-framework-issues@208a6cb
1 votes, 3 watchers
Michel Zanini opened SPR-9239 and commented
@RequestBodyshould have a required parameter to allow a request body to be optional, if the body is empty my object is null, otherwise it is parsed using a http message converter.At the moment I am using a Jackson (JSON) converter and if I use it as bellow:
@RequestMapping(method = RequestMethod.POST, value = "/url")public String method(
@RequestBodyMyBody myBody) {...
}
Then, if I send an empty body it will throw an java.io.EOFException.
In this case I would like to receive null in myBody and execute my method anyway.
This issue maybe related to https://jira.springsource.org/browse/SPR-9238.
Affects: 3.1.1
Issue Links:
@RequestBody(required=true) not obeyed@RequestBodymarshalling throws java.io.EOFException when body is missing@RequestBody(required=false)@RequestBodyReferenced from: commits spring-attic/spring-framework-issues@208a6cb
1 votes, 3 watchers