Let's see the following updated Docket bean configuration:
@Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.basePackage("com.dineshonjava.accountservice.controller")) .paths(PathSelectors.ant("/customer/*")) .build(); }
In the preceding configuration of the Docket bean, we have filtered some APIs from the documentation. Sometimes, we don't want to expose the documentation of some APIs. You can pass parameters to the apis() and paths() methods of the Docket class to restrict Swagger's response. The RequestHandlerSelectors class allows you to use the any or none predicates. You can use RequestHandlerSelectors to filter the API according ...