James W. Carman created CXF-8583:
------------------------------------
Summary: OpenApiFeature Always Appends Numbered Suffix (i.e. "_1")
to operationId
Key: CXF-8583
URL: https://issues.apache.org/jira/browse/CXF-8583
Project: CXF
Issue Type: Bug
Components: JAX-RS
Affects Versions: 3.4.4
Reporter: James W. Carman
It appears that the duplicate calls to OpenApiContext.read() are causing it to
think the operationIds are duplicated, thus causing it to append a "_1" (or
whatever the counter gets to) to the operationIds in order to make them unique.
Here's my understanding of what's causing the collisions:
In OpenApiCustomizedResource, it calls the OpenApiContext.read() operation here:
[https://github.com/apache/cxf/blob/75fb6bb56d82f72771a9ee6ecab5d36168303f51/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiCustomizedResource.java#L77]
At the end of the method, though, it makes a call to the superclass'
implementation of the getOpenApi() method here:
[https://github.com/apache/cxf/blob/75fb6bb56d82f72771a9ee6ecab5d36168303f51/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiCustomizedResource.java#L106]
The overridden BaseOpenApiResource class' implementation of getOpenApi()
subsequently calls OpenApiContext.read() again here:
[https://github.com/swagger-api/swagger-core/blob/v2.1.6/modules/swagger-jaxrs2/src/main/java/io/swagger/v3/jaxrs2/integration/resources/BaseOpenApiResource.java#L51]
It is during this second invocation of the OpenApiContext.read() method in the
superclass where the operatorId collisions occur.
I am happy to submit a patch to address it, but I do ask for a little guidance
here on how we'd like to fix this, please. It would seem that this would break
existing behavior and I don't want to mess anyone up.
Thanks,
James
--
This message was sent by Atlassian Jira
(v8.3.4#803005)