This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch camel-3.11.x in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.11.x by this push: new 12eb4aa CAMEL-17060: camel-openapi-java - The rest api can fail due to two unknown properties on endpoint 12eb4aa is described below commit 12eb4aade0cc9599b9b4f9ef62a0717473ff1c19 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Sat Oct 9 17:43:40 2021 +0200 CAMEL-17060: camel-openapi-java - The rest api can fail due to two unknown properties on endpoint --- .../java/org/apache/camel/component/rest/RestApiEndpoint.java | 3 ++- .../main/java/org/apache/camel/model/rest/RestDefinition.java | 11 ++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java index 7a27cdd..42619e1 100644 --- a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java +++ b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java @@ -19,6 +19,7 @@ package org.apache.camel.component.rest; import java.util.Map; import java.util.Set; +import org.apache.camel.Category; import org.apache.camel.Component; import org.apache.camel.Consumer; import org.apache.camel.ExchangePattern; @@ -43,7 +44,7 @@ import org.apache.camel.util.ObjectHelper; * Expose OpenAPI Specification of the REST services defined using Camel REST DSL. */ @UriEndpoint(firstVersion = "2.16.0", scheme = "rest-api", title = "REST API", syntax = "rest-api:path/contextIdPattern", - consumerOnly = true, label = "core,rest", lenientProperties = true) + consumerOnly = true, category = { Category.CORE, Category.REST }, lenientProperties = true) public class RestApiEndpoint extends DefaultEndpoint { public static final String DEFAULT_API_COMPONENT_NAME = "openapi"; diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestDefinition.java index 5a982ac..2ac3b7b 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestDefinition.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestDefinition.java @@ -754,20 +754,17 @@ public class RestDefinition extends OptionalIdentifiedDefinition<RestDefinition> // create the from endpoint uri which is using the rest-api component String from = "rest-api:" + configuration.getApiContextPath(); - // append options - Map<String, Object> options = new HashMap<>(); - String routeId = configuration.getApiContextRouteId(); if (routeId == null) { routeId = answer.idOrCreate(camelContext.adapt(ExtendedCamelContext.class).getNodeIdFactory()); } - options.put("routeId", routeId); + + // append options + Map<String, Object> options = new HashMap<>(); + if (configuration.getComponent() != null && !configuration.getComponent().isEmpty()) { options.put("consumerComponentName", configuration.getComponent()); } - if (configuration.getComponent() != null && !configuration.getComponent().isEmpty()) { - options.put("producerComponentName", configuration.getProducerComponent()); - } if (configuration.getApiContextIdPattern() != null) { options.put("contextIdPattern", configuration.getApiContextIdPattern()); }