I am developing a REST based application using the Java & Quarkus. I am using the annotations from OpenAPI to create the swagger-ui. I have multiple resource file within my application. I would like to order them as per my choice also I would like to order the api endpoints within each of the resource files as per my choice. How can I achieve this?
I saw some examples examples related to it, but they are based on the Spring, so I am a bit confused about how to achieve the same thing using the Quarkus.
For example, I have created 2 resource files. Lets say the extensions
endpoints are appearing on top of the fruits
in the Swagger-UI. I need to ensure the fruits
appear first then the extensions
. Also the endpoints within the extensions
and fruits
should appear in the described order then how can I achieve this?
@Path("/api")
@Tag(
name = "Fuits Controller",
description = "Fruits Information")
public class FruitResource {
@GET
@Path("/get/fruits")
public String list() {
return fruits;
}
@POST
@Path("/post/fruits")
public String list() {
return fruits;
}
}
@Path("/api")
@Tag(
name = "Extensions Controller",
description = "Extensions Information")
public interface 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;
}
}