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

Claus Ibsen edited comment on CAMEL-17139 at 11/2/21, 7:14 PM:
---------------------------------------------------------------

You should likely set

  camel.rest.context-path: /camel/api

As you cannot get the servlet context-path it has been configured with, so you 
need to specify this in the rest-dsl


was (Author: davsclaus):
You should likely set

  context-path: /camel/api

As you cannot get the servlet context-path it has been configured with, so you 
need to specify this in the rest-dsl

> 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