Docket Beans for Swagger Config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
public Docket allApi() { | |
return new Docket(DocumentationType.SWAGGER_2) | |
.groupName("All APIs") | |
.select() | |
.apis(RequestHandlerSelectors.basePackage("com.tan.myswaggeruiexample.controller")) | |
.paths(PathSelectors.any()) | |
.build() | |
.apiInfo(apiInfo()); | |
} | |
@Bean | |
public Docket customerApi() { | |
return new Docket(DocumentationType.SWAGGER_2) | |
.groupName("Customer APIs") | |
.select() | |
.apis(RequestHandlerSelectors.basePackage("com.tan.myswaggeruiexample.controller")) | |
.paths(PathSelectors.regex("/customer.*")) | |
.build() | |
.apiInfo(apiInfo()); | |
} | |
@Bean | |
public Docket customerRefApi() { | |
return new Docket(DocumentationType.SWAGGER_2) | |
.groupName("Customer Ref APIs") | |
.select() | |
.apis(RequestHandlerSelectors.basePackage("com.tan.myswaggeruiexample.controller")) | |
.paths(PathSelectors.regex("/refCustomer.*")) | |
.build() | |
.apiInfo(apiInfo()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment