OpenAPITools / OpenAPITools/openapi-generator
Java Quarkus OpenAPI: How to order various paths in a Quarkus resource?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported Quarkus resource annotations and the generated Swagger-UI path list. Determine whether endpoint ordering is configurable through the OpenAPI annotations or Swagger-UI configuration; done means documenting the supported approach or closing this as an unsupported request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100