Tomek created CAMEL-17139:
-----------------------------

             Summary: 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


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" functionallity for my services.

 



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

Reply via email to