You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/03/02 11:45:00 UTC

[jira] [Commented] (CAMEL-23115) camel-openapi-java - base.path option will never survive if context-path is set

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

Claus Ibsen commented on CAMEL-23115:
-------------------------------------

You can send a PR

> camel-openapi-java - base.path option will never survive if context-path is set
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-23115
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23115
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-openapi-java
>    Affects Versions: 4.19.0
>            Reporter: Michael Frankfurter
>            Priority: Minor
>
> The OpenApi specification allows us to specify the host, port & path that is serving the API. In OpenAPI V3 it is part of the {{servers}} field.
> In camel-openapi-java it is possible to influence this via three different options: host, schemes, base.path.
> Unfortunately, this {{base.path}} option will not be used every time {{contextPath}} is present. But this is exactly what should be replaced.
> The current code in [OpenApiRestApiProcessorFactory|https://github.com/apache/camel/blob/main/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiRestApiProcessorFactory.java#L70] should be changed from
> {code:java}
> String path = configuration.getContextPath();
> if (path != null) {
>   options.put("base.path", path);
> }{code}
> to
> {code:java}
> if (!options.contains("base.path") && configuration.getContextPath() != null) {
>   options.put("base.path", configuration.getContextPath());
> }{code}
> to fulfill that replacement.
> I have just put the affected version 4.19.0 but it is like that in all of the version.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)