This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 5c257cb CAMEL-17060: camel-openapi-java - The rest api can fail due
to two unknown properties on endpoint
5c257cb is described below
commit 5c257cb4cdbd82fcaa7814e2536ed66a8fcf4b44
Author: Claus Ibsen <[email protected]>
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 777c267..e56a633 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
@@ -776,20 +776,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());
}