This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-4.10.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.10.x by this push:
new a35503a1b8f Rest-openapi: avoid duplicated context paths (#18775)
a35503a1b8f is described below
commit a35503a1b8ff1f7cd01d6ec9ce3b21ab9a8e53eb
Author: JiriOndrusek <[email protected]>
AuthorDate: Wed Jul 30 20:17:43 2025 +0200
Rest-openapi: avoid duplicated context paths (#18775)
---
.../apache/camel/component/rest/openapi/RestOpenApiEndpoint.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git
a/components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java
b/components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java
index 0684844c045..abe9ff49c4e 100644
---
a/components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java
+++
b/components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java
@@ -295,6 +295,12 @@ public final class RestOpenApiEndpoint extends
DefaultEndpoint {
if (factory != null) {
RestConfiguration config =
CamelContextHelper.getRestConfiguration(getCamelContext(), cname);
+
+ // avoid duplicate context-path
+ if (basePath.equals(config.getContextPath())) {
+ basePath = "";
+ }
+
Map<String, Object> copy = new HashMap<>(parameters); // defensive
copy of the parameters
Consumer consumer = factory.createConsumer(getCamelContext(),
processor, basePath, config, copy);
if (consumer instanceof PlatformHttpConsumerAware phca) {