You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Karen Lease (Jira)" <ji...@apache.org> on 2022/01/13 16:37:00 UTC

[jira] [Assigned] (CAMEL-17457) camel-openapi-java - Incorrect tags in openapi

     [ https://issues.apache.org/jira/browse/CAMEL-17457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karen Lease reassigned CAMEL-17457:
-----------------------------------

    Assignee: Karen Lease

> 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
>            Assignee: Karen Lease
>            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)