Search code examples
scalarestswagger

How to hide a parameter in swagger?


did anyone succeed to hide a parameter from generated documentation? I found an issue here, but using @ApiParam(access="internal", required=false) before @HeaderParam did not seem to work.


Solution

  • Hope this helps.

    For Fields

    @ApiModelProperty(required = false, hidden = true)
    private String hiddenProperty
    

    For Apis

    @ApiIgnore
    public class MyApi {}
    

    For Parameters

    public void getApi(@ApiIgnore String param){}
    
    @ApiModelProperty(hidden="true")
    public String paramInsideClass