Issue with API Versioning: All APIs Merged into Single V1Resource.java Class #876
Unanswered
thongdanghoang
asked this question in
Q&A
Replies: 1 comment
-
cc @carlesarnal can you please take a look? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using the quarkus-openapi-generator-server to generate server code from the OpenAPI YAML specification, all API paths with the same versioning prefix (e.g., /v1/...) are merged into a single resource class (V1Resource.java). This behavior is problematic because it does not reflect the intended grouping of endpoints by their respective tags (e.g., InventoriesResource, PermissionsResource).
For example, the following OpenAPI YAML:
My Quarkus application.yml:
And quarkus-openapi-generator-server versio:
<quarkus-openapi-generator-server.version>2.6.0-lts</quarkus-openapi-generator-server.version>
Generates a single V1Resource.java class instead of separate classes (InventoriesResource.java and PermissionsResource.java).
Expected Behavior:
The generator should create separate resource classes based on the tags property in the OpenAPI YAML. For the example above, it should generate:
InventoriesResource.java containing /v1/inventory-related endpoints.
PermissionsResource.java containing /v1/permissions/inventories-related endpoints.
Actual Behavior:
All endpoints with the /v1/... prefix are merged into a single class: V1Resource.java.
Steps to Reproduce:
Create an OpenAPI YAML specification with versioned paths (e.g., /v1/...).
Use the quarkus-openapi-generator-server to generate the server code.
Observe that all endpoints are grouped into a single resource class based on the version prefix.
Beta Was this translation helpful? Give feedback.
All reactions