api-doc-template icon indicating copy to clipboard operation
api-doc-template copied to clipboard

@RequestBody default required = true?

Open bc-2 opened this issue 10 years ago • 0 comments

Hi,

Processing the following Spring MVC controller operation results in a "body" parameter with "required: false":

public void addObject(@ApiParam(value = "Object to add") @RequestBody Object theObject)

However, @RequestBody is by default required if the 'required' attribute is not specified. Shouldn't the body parameter in the Swagger JSON be required too, then?

Regards, Bruno

bc-2 avatar May 22 '15 14:05 bc-2