How can I add the sorting order for my API path endpoints using the Java OpenAPI annotations? I am currently using Quarkus
to develop a rest-based application within that I am using the OpenAPI annotations to generate the Swagger-UI but I am not able to control the orders for various paths that appear. Is there a way to achieve this by forcing the OpenAPI to always sort as per my need?
Following are multiple resources and endpoints I have:
ExtensionsResource:
@Path("/api")
@Tag(
name = "Extensions Controller",
description = "Extensions Information")
public class ExtensionResource {
@POST
@Path("/post/extensions")
public String list() {
return extension;
}
@GET
@Path("/get/extension")
public String list() {
return extension;
}
@POST
@Path("/post/extension")
public String list() {
return extension;
}
}
I always want to ensure that the swagger-ui displays the API endpoints in the following order:
1. api/get/extension
2. api/post/extension
3. api/post/extensions
This above code is just for reference my actual code looks different I just want to know how to force the ordering of endpoints in Swagger-UI using the OpenAPI annotation.
Updated
The contents of my application.yaml
file looks something like this:
quarkus:
swagger-ui:
always-include: true
tagsSorter: "alpha"
operationsSorter: "alpha"
http:
cors: true
port: 9000