How to hide endpoints from Swagger documentation with Springfox

前端 未结 5 1543
深忆病人
深忆病人 2021-01-04 12:03

I have a Spring Boot project with next dependency of Springfox:


    io.springfox
    spri         


        
5条回答
  •  一个人的身影
    2021-01-04 12:54

    The scenario where we want to hide only a particular method(s) from the class. For swagger.v3 there is an annotation with name Hidden in io.swagger.core.v3:swagger-annotations:2.0.10 jar. Methods to be hidden can be annotated with Hidden annotation as shown below. The below method shows the method with DELETE operation which needs to be hidden from the swagger documentation.

    @DELETE
    @Hidden
    public void deleteList(int id) {
    //code goes here.
    }
    

提交回复
热议问题