You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use CLASS_METHOD as operationId generation strategy, and my resource implements an interface, the interface name is used for operationId instead of the concrete jaxrs resource class's name.
So, in the case of
GreetingInterface -> GreetingResource
it should generate: operationId: GreetingResource_hello,
but it does: operationId: GreetingInterface_hello
When I use
CLASS_METHOD
as operationId generation strategy, and my resource implements an interface, the interface name is used for operationId instead of the concrete jaxrs resource class's name.So, in the case of
GreetingInterface
->GreetingResource
it should generate:
operationId: GreetingResource_hello
,but it does:
operationId: GreetingInterface_hello
This is a problem since when I have for example
GreetingResourceA implements GreetingInterface
GreetingResourceB implements GreetingInterface
I will get duplicate operationId errors when generating a client (
GreetingInterface_hello
,GreetingInterface_hello
).My concrete use case is an annotated interface (and implementation) for basic CRUD operations so I don't need to repeat them for each model.
I tried to do some digging and testing, but couldn't get the existing unit test to pick up my example resource (result was always empty).
Here is the implementation and the test in the smallrye-openapi code:
https://github.com/smallrye/smallrye-open-api/blob/main/core/src/main/java/io/smallrye/openapi/runtime/io/operation/OperationReader.java#L145
https://github.com/smallrye/smallrye-open-api/blob/main/extension-jaxrs/src/test/java/io/smallrye/openapi/runtime/scanner/OperationIdTest.java
Here are an example and a link to a quarkus example project.
Example:
Result:
expected:
operationId: GreetingResource_hello
actual:
operationId: GreetingInterface_hello
Example Repo URL: https://github.com/codegourmet/openapi-operationid-example
The text was updated successfully, but these errors were encountered: