I'm setting two different Docket API in one spring boot application. I gave one Docket "Test" groupName and leave the other, so it ended up as "default" in the Swagger UI.
My question is, how to arrange the order of these Dockets in the UI.
At first, I thought it was arranged alphabetically, but it's not. I keep changing the name, but the order is unknown.
@Bean
public Docket myAPI(){
Docket docket = new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("anything"))
.paths(PathSelectors.regex("/v1/anything.*"))
.build()
.apiInfo(apiInfo());
buildGlobalParameter(docket);
buildGlobalResponseMessage(docket);
return docket;
}
@Bean
public Docket testAPI(){
Docket tDocket = new Docket(DocumentationType.SWAGGER_2)
.groupName("Test Card")
.select()
.apis(RequestHandlerSelectors.basePackage("anything"))
.paths(PathSelectors.regex("/v1/anything2*"))
.build()
.apiInfo(apiTestInfo());
buildGlobalParameter(tDocket);
buildGlobalResponseMessage(tDocket);
return tDocket;
}
https://i.stack.imgur.com/bAmNm.jpg
I am sorry, I cannot post the image yet, so I am leaving the direct URL.
When I run the spring boot application, I want the default Swagger UI's displayed to be the "default" one.