[
https://issues.apache.org/jira/browse/CAMEL-17535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17480185#comment-17480185
]
Karen Lease commented on CAMEL-17535:
-------------------------------------
The workaround mentioned in CAMEL-17139:
{code:java}
springdoc:
swagger-ui:
url: ${camel.rest.context-path}${camel.rest.api-context-path}
{code}
does resolve the problem by working around the root cause.
The root cause is that the OpenAPI bean generated by SpringdocAutoConfiguration
does not set the URL for the api doc, because it assumes Springdoc should set
it. But Springdoc only uses its own context path (server.servlet.context-path)
and does not append the camel.rest.context-path.
Forcing the swagger-ui.url property to include both the Spring context-path (if
any) and the Camel context-path will override the link to the generated API
docs. In fact, this causes the Swagger UI to refer to the OpenAPI doc which is
generated by the code in camel-openapi-java which correctly generates a
relative URL. The incorrect doc generated by the Springdoc configuration is
present but is not referenced from the SwaggerUI.
Ideally, the Camel springdoc starter component would generate the correct
relative URL so that users are not obliged to use the workaround.
> camel-example-spring-boot-rest-openapi-springdoc generates incorrect api doc
> ----------------------------------------------------------------------------
>
> Key: CAMEL-17535
> URL: https://issues.apache.org/jira/browse/CAMEL-17535
> Project: Camel
> Issue Type: Bug
> Affects Versions: 3.14.0
> Reporter: Karen Lease
> Assignee: Karen Lease
> Priority: Minor
>
> The example camel-example-spring-boot-rest-openapi-springdoc generates a
> swagger OpenAPI document which doesn't contain the correct context path. The
> Swagger UI isn't able to execute the operations because it doesn't include
> the /api in the path.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)