Skip to content

Instantly share code, notes, and snippets.

@evrentan
Created July 10, 2021 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evrentan/88694d2ebb57814a9e84d45d62a79b2f to your computer and use it in GitHub Desktop.
Save evrentan/88694d2ebb57814a9e84d45d62a79b2f to your computer and use it in GitHub Desktop.
Docket Beans for Swagger Config
@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