[ 
https://issues.apache.org/jira/browse/CAMEL-17139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17438517#comment-17438517
 ] 

Claus Ibsen commented on CAMEL-17139:
-------------------------------------

The servlet spec does not allow to get hold of any configured servlet 
context-path in a standard way - hence you should set this in the camel 
rest-dsl configuration what this path is.

serverl.servlet-context-path is a spring boot configuration, not a Camel 
configuration

> camel-openapi-java ignores server.servlet.context-path when generating api doc
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-17139
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17139
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-openapi-java
>    Affects Versions: 3.11.3
>            Reporter: Tomek
>            Priority: Minor
>         Attachments: camel-openapi.zip
>
>
> In my configuration I have defined both server.servlet.context-path and 
> camel.rest.context-path properties. Part of my application.yml file:
> {code:java}
> server:
>   port: 8080
>   servlet:
>     context-path: /camel
> camel:
>   rest:
>     component: servlet
>     context-path: /api
>     binding-mode: json
>     data-format-property: { prettyPrint: "true" }
>     api-context-path: /api-doc
>     api-component: openapi
>     api-property: { api.title: "Camel Component API",
>                     api.version: "1.0.0",
>                     api.cors: "true" }
>     api-vendor-extension: false
> servlet:
>   mapping:
>     context-path: ${camel.rest.context-path}/*
> {code}
> I've checked the generated api-doc YAML and the servers/url objects contains 
> invalid entries, for exampe:
> {code:java}
> "servers" : [ {
>     "url" : "/api"
>   } ],
> {code}
> instead of
> {code:java}
> "servers" : [ {
>     "url" : "/camel/api"
>   } ],
> {code}
> This causes issues when using Swagger UI - all endpoint URLs are invalid and 
> I can't use the "Try it out" functionality for my services.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to