You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Avinash Dongre (Jira)" <ji...@apache.org> on 2021/07/08 12:58:00 UTC

[jira] [Commented] (CAMEL-16793) apiHost option in REST DSL is ignored

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

Avinash Dongre commented on CAMEL-16793:
----------------------------------------

From the Openapi perspective, this doesn't look like a bug. It is setting the URL that way because you are not sending any X-Forward headers. Either disable using the X-Forward headers like so:

 
{code:java}
restConfiguration().component("undertow").contextPath("/rest")
        .useXForwardHeaders(false)
        .port(8090)
        .apiContextPath("/api")
{code}
Or, use the X-Forward headers when you call the API context:

 

 
{code:java}
curl -H "X-Forwarded-Proto: http" -H  "X-Forwarded-Host: example.com" http://localhost:8080/rest/api

{code}
It will give you a result like this:
{code:java}
  "servers" : [ {

    "url" : "http://example.com/rest"

  } ],

{code}
 

> apiHost option in REST DSL is ignored
> -------------------------------------
>
>                 Key: CAMEL-16793
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16793
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-openapi-java, camel-swagger-java
>    Affects Versions: 2.25.3, 3.11.0
>            Reporter: Grigorii Ivanov
>            Priority: Major
>             Fix For: 3.12.0
>
>
> From documentation - https://camel.apache.org/manual/latest/rest-dsl.html#_configuring_rest_dsl
> |apiHost|-|Specific hostname for the API documentation (eg swagger)
> This can be used to override the generated host with this configured hostname|
> In fact the option's value gets lost with both camel-swagger and camel-oneapi components, see also [camel mailing list|https://lists.apache.org/thread.html/rc002471d17e51a902d9eca062f2336b71403486753fe5173bb62f43c@%3Cusers.camel.apache.org%3E]
>  



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