[
https://issues.apache.org/jira/browse/CAMEL-17457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17474880#comment-17474880
]
Karen Lease commented on CAMEL-17457:
-------------------------------------
I suggest to change the generated tag so it would be just "/users" in this
example. There is no way in the Camel Rest DSL to specify multiple tags and
associate different operations to different tags, so it would make sense to use
the main path specified in rest(path). Adding the context path (/api) doesn't
add anything useful.
> camel-openapi-java - Incorrect tags in openapi
> ----------------------------------------------
>
> Key: CAMEL-17457
> URL: https://issues.apache.org/jira/browse/CAMEL-17457
> Project: Camel
> Issue Type: Bug
> Components: camel-openapi-java
> Affects Versions: 3.14.0, 3.15.0
> Reporter: ncasaux
> Priority: Minor
> Labels: documentation, openapi
> Fix For: 3.15.0, 3.14.1
>
>
> Hello,
> I'm using provided example: Spring Boot Example with Camel REST DSL and
> OpenApi
> ([https://github.com/apache/camel-spring-boot-examples/tree/main/rest-openapi-springdoc)]
> I noticed that the generated tags are incorrect and contains some duplicate
> values, for example:
> {code:java}
> "/api/users" : {
> "get" : {
> "tags" : [ "/api/users/users" ],
> "responses" : {
> "200" : {
> "content" : {
> "application/json" : {
> "schema" : {
> "type" : "array",
> "items" : {
> "$ref" : "#/components/schemas/User"
> }
> }
> }
> },
> "description" : "All users successfully returned"
> }
> },
> "operationId" : "verb1",
> "summary" : "Find all users"
> }
> }{code}
> Note the value "{{{}/api/users/users"{}}}
> I tried to investigate in the source code of the component, and I found this
> line of code in class RestOpenApiReader:
> {code:java}
> // we need to group the operations within the same tag, so use the path as
> default if not configured
> String opPath = OpenApiHelper.buildUrl(buildBasePath(camelContext, rest),
> getValue(camelContext, rest.getPath()));
> String pathAsTag = getValue(camelContext, rest.getTag() != null ?
> rest.getTag() : opPath);{code}
> I don't really understand the purpose of the opPath value, which contains the
> concatenation of "/api/users" and "/users". I guess it should be "/api/users"
> ?
> It explains however why the pathAsTag value is consequently incorrect.
> Hope it helps!
--
This message was sent by Atlassian Jira
(v8.20.1#820001)