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

Tomek commented on CAMEL-17139:
-------------------------------

Hi,

We can't apply this workaround. Our application is containerized and we need 
all the served URLs to have specific context path. Empty 
server.servlet.context-path causes a lot of further problems, f.e. with Spring 
Security and it's default login / logout URLs etc. We also have to change 
actuator configuration and a lot of other settings.

I think camel-openapi-java should use both server.servlet.context-path and 
camel.rest.context-path - otherwise in general it ignores the server 
configuration, which is a bug in my opinion.

> 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