I am using swagger 2.9.2 version and i want to display endpoints like Get, Post, Put, Patch, Delete. I referred this post Swagger API Operations Ordering which is must similar to my requirement and it working in ascending order but I want to display endpoint as mentioned above order.
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors
.basePackage("com.xxx.xxx.controller"))
.paths(PathSelectors.any()).build()
.useDefaultResponseMessages(false)
.apiInfo(metaData());
}
private ApiInfo metaData() {
return new ApiInfoBuilder()
.title("test data")
.description("test data")
.version("1.0.0")
.build();
}
@Bean
UiConfiguration uiConfig() {
return UiConfigurationBuilder
.builder()
.operationsSorter(OperationsSorter.METHOD)
.build();
}
}