swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

JAX-RS ignores required attribute for body parameters

Open sanchopancho13 opened this issue 11 years ago • 2 comments

When using the @ApiParam annotation for a body parameter, the required attribute is being ignored. It seems that the ParameterProcessor class is not calling the BodyParameter.setRequired() method, however it does set the value correctly for non-body parameters.

You can find an example of this in the java-jaxrs project. The UserResource class has a method called updateUser() which has a path parameter and also a body parameter. Both are set to required, however the generated document only specifies the path parameter as required.

I tested this in version 1.5.1-M2.

sanchopancho13 avatar Apr 09 '15 04:04 sanchopancho13

Working on.

MDoumin avatar Apr 14 '15 17:04 MDoumin

Fixed in develop_2.0.

webron avatar May 06 '15 12:05 webron