I am generating swagger docs for my REST API. The generated docs show the params are required. How to make them not-required in swagger ? In actual REST invocations they are not-required (as expected); so problem is just in documentation.
import javax.ws.rs.*; @GET @Produces(MediaType.APPLICATION_JSON) public Response getBaz( @DefaultValue("false") @QueryParam("foo") final boolean myFoo, @DefaultValue("") @QueryParam("bar") final String myBar ) { ... } The generated swagger.json has
... "parameters":[{ ... snip "myBar":"bar","required":true}