You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/09/08 10:24:31 UTC

[camel] branch master updated: CAMEL-15512: Remove the default value for apiComponent on RestConfigurationDefinition (#4172)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 3b87a17  CAMEL-15512: Remove the default value for apiComponent on RestConfigurationDefinition (#4172)
3b87a17 is described below

commit 3b87a17cc6102c5e9076a55ee38abb531ceb1e13
Author: Luca Burgazzoli <lb...@users.noreply.github.com>
AuthorDate: Tue Sep 8 12:24:15 2020 +0200

    CAMEL-15512: Remove the default value for apiComponent on RestConfigurationDefinition (#4172)
---
 .../camel/catalog/main/camel-main-configuration-metadata.json     | 2 +-
 .../org/apache/camel/catalog/models/restConfiguration.json        | 2 +-
 .../src/main/java/org/apache/camel/spi/RestConfiguration.java     | 8 ++++----
 .../resources/org/apache/camel/model/rest/restConfiguration.json  | 2 +-
 .../org/apache/camel/model/rest/RestConfigurationDefinition.java  | 7 +++++--
 .../resources/META-INF/camel-main-configuration-metadata.json     | 2 +-
 core/camel-main/src/main/docs/main.adoc                           | 2 +-
 docs/components/modules/others/pages/main.adoc                    | 2 +-
 8 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
index 9d45a70..631931e 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
@@ -165,7 +165,7 @@
     { "name": "camel.resilience4j.timeoutExecutorServiceRef", "description": "References to a custom thread pool to use when timeout is enabled (uses ForkJoinPool#commonPool() by default)", "sourceType": "org.apache.camel.main.Resilience4jConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
     { "name": "camel.resilience4j.waitDurationInOpenState", "description": "Configures the wait duration (in seconds) which specifies how long the CircuitBreaker should stay open, before it switches to half open. Default value is 60 seconds.", "sourceType": "org.apache.camel.main.Resilience4jConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer", "defaultValue": 60 },
     { "name": "camel.resilience4j.writableStackTraceEnabled", "description": "Enables writable stack traces. When set to false, Exception.getStackTrace returns a zero length array. This may be used to reduce log spam when the circuit breaker is open as the cause of the exceptions is already known (the circuit breaker is short-circuiting calls).", "sourceType": "org.apache.camel.main.Resilience4jConfigurationProperties", "type": "boolean", "javaType": "java.lang.Boolean" },
-    { "name": "camel.rest.apiComponent", "description": "Sets the name of the Camel component to use as the REST API (such as swagger)", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaType": "java.lang.String" },
+    { "name": "camel.rest.apiComponent", "description": "Sets the name of the Camel component to use as the REST API (such as swagger or openapi)", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaType": "java.lang.String" },
     { "name": "camel.rest.apiContextIdPattern", "description": "Optional CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name matches the pattern. The pattern #name# refers to the CamelContext name, to match on the current CamelContext only. For any other value, the pattern uses the rules from org.apache.camel.support.EndpointHelper#matchPattern(String,String)", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaT [...]
     { "name": "camel.rest.apiContextListing", "description": "Sets whether listing of all available CamelContext's with REST services in the JVM is enabled. If enabled it allows to discover these contexts, if false then only the current CamelContext is in use.", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "boolean", "javaType": "boolean" },
     { "name": "camel.rest.apiContextPath", "description": "Sets a leading API context-path the REST API services will be using. This can be used when using components such as camel-servlet where the deployed web application is deployed using a context-path.", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaType": "java.lang.String" },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/restConfiguration.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/restConfiguration.json
index 740e78c..e675cb8 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/restConfiguration.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/restConfiguration.json
@@ -12,7 +12,7 @@
   },
   "properties": {
     "component": { "kind": "attribute", "displayName": "Component", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The Camel Rest component to use for the REST transport (consumer), such as netty-http, jetty, servlet, undertow. If no component has been explicit configured, then Camel will lookup if there is a Camel component that integrates with the Rest DSL, or if a org.apache.camel.spi.RestConsumerFactory is re [...]
-    "apiComponent": { "kind": "attribute", "displayName": "Api Component", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "swagger", "description": "The name of the Camel component to use as the REST API (such as swagger)" },
+    "apiComponent": { "kind": "attribute", "displayName": "Api Component", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The name of the Camel component to use as the REST API (such as swagger) If no API Component has been explicit configured, then Camel will lookup if there is a Camel component responsible for servicing and generating the REST API documentation, or if a org.apache.camel.spi.RestApiProcessorFact [...]
     "producerComponent": { "kind": "attribute", "displayName": "Producer Component", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Sets the name of the Camel component to use as the REST producer" },
     "scheme": { "kind": "attribute", "displayName": "Scheme", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The scheme to use for exposing the REST service. Usually http or https is supported. The default value is http" },
     "host": { "kind": "attribute", "displayName": "Host", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The hostname to use for exposing the REST service." },
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/RestConfiguration.java b/core/camel-api/src/main/java/org/apache/camel/spi/RestConfiguration.java
index 69c4d3d..d73f1e6 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/RestConfiguration.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/RestConfiguration.java
@@ -97,18 +97,18 @@ public class RestConfiguration {
     }
 
     /**
-     * Gets the name of the Camel component to use as the REST API (such as swagger)
+     * Gets the name of the Camel component to use as the REST API (such as swagger or openapi).
      *
-     * @return the component name, or <tt>null</tt> to let Camel use the default name <tt>swagger</tt>
+     * @return the component name
      */
     public String getApiComponent() {
         return apiComponent;
     }
 
     /**
-     * Sets the name of the Camel component to use as the REST API (such as swagger)
+     * Sets the name of the Camel component to use as the REST API (such as swagger or openapi)
      *
-     * @param apiComponent the name of the component (such as swagger)
+     * @param apiComponent the name of the component (such as swagger or openapi)
      */
     public void setApiComponent(String apiComponent) {
         this.apiComponent = apiComponent;
diff --git a/core/camel-core-engine/src/generated/resources/org/apache/camel/model/rest/restConfiguration.json b/core/camel-core-engine/src/generated/resources/org/apache/camel/model/rest/restConfiguration.json
index 740e78c..e675cb8 100644
--- a/core/camel-core-engine/src/generated/resources/org/apache/camel/model/rest/restConfiguration.json
+++ b/core/camel-core-engine/src/generated/resources/org/apache/camel/model/rest/restConfiguration.json
@@ -12,7 +12,7 @@
   },
   "properties": {
     "component": { "kind": "attribute", "displayName": "Component", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The Camel Rest component to use for the REST transport (consumer), such as netty-http, jetty, servlet, undertow. If no component has been explicit configured, then Camel will lookup if there is a Camel component that integrates with the Rest DSL, or if a org.apache.camel.spi.RestConsumerFactory is re [...]
-    "apiComponent": { "kind": "attribute", "displayName": "Api Component", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "swagger", "description": "The name of the Camel component to use as the REST API (such as swagger)" },
+    "apiComponent": { "kind": "attribute", "displayName": "Api Component", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The name of the Camel component to use as the REST API (such as swagger) If no API Component has been explicit configured, then Camel will lookup if there is a Camel component responsible for servicing and generating the REST API documentation, or if a org.apache.camel.spi.RestApiProcessorFact [...]
     "producerComponent": { "kind": "attribute", "displayName": "Producer Component", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Sets the name of the Camel component to use as the REST producer" },
     "scheme": { "kind": "attribute", "displayName": "Scheme", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The scheme to use for exposing the REST service. Usually http or https is supported. The default value is http" },
     "host": { "kind": "attribute", "displayName": "Host", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The hostname to use for exposing the REST service." },
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/rest/RestConfigurationDefinition.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/rest/RestConfigurationDefinition.java
index 683ed60..e2c943e 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/rest/RestConfigurationDefinition.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/rest/RestConfigurationDefinition.java
@@ -45,7 +45,7 @@ public class RestConfigurationDefinition {
     private String component;
 
     @XmlAttribute
-    @Metadata(label = "consumer", defaultValue = "swagger")
+    @Metadata(label = "consumer")
     private String apiComponent;
 
     @XmlAttribute
@@ -160,7 +160,10 @@ public class RestConfigurationDefinition {
     }
 
     /**
-     * The name of the Camel component to use as the REST API (such as swagger)
+     * The name of the Camel component to use as the REST API (such as swagger) If no API Component has been explicit
+     * configured, then Camel will lookup if there is a Camel component responsible for servicing and generating the
+     * REST API documentation, or if a org.apache.camel.spi.RestApiProcessorFactory is registered in the registry. If
+     * either one is found, then that is being used.
      */
     public void setApiComponent(String apiComponent) {
         this.apiComponent = apiComponent;
diff --git a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
index 9d45a70..631931e 100644
--- a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
+++ b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
@@ -165,7 +165,7 @@
     { "name": "camel.resilience4j.timeoutExecutorServiceRef", "description": "References to a custom thread pool to use when timeout is enabled (uses ForkJoinPool#commonPool() by default)", "sourceType": "org.apache.camel.main.Resilience4jConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
     { "name": "camel.resilience4j.waitDurationInOpenState", "description": "Configures the wait duration (in seconds) which specifies how long the CircuitBreaker should stay open, before it switches to half open. Default value is 60 seconds.", "sourceType": "org.apache.camel.main.Resilience4jConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer", "defaultValue": 60 },
     { "name": "camel.resilience4j.writableStackTraceEnabled", "description": "Enables writable stack traces. When set to false, Exception.getStackTrace returns a zero length array. This may be used to reduce log spam when the circuit breaker is open as the cause of the exceptions is already known (the circuit breaker is short-circuiting calls).", "sourceType": "org.apache.camel.main.Resilience4jConfigurationProperties", "type": "boolean", "javaType": "java.lang.Boolean" },
-    { "name": "camel.rest.apiComponent", "description": "Sets the name of the Camel component to use as the REST API (such as swagger)", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaType": "java.lang.String" },
+    { "name": "camel.rest.apiComponent", "description": "Sets the name of the Camel component to use as the REST API (such as swagger or openapi)", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaType": "java.lang.String" },
     { "name": "camel.rest.apiContextIdPattern", "description": "Optional CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name matches the pattern. The pattern #name# refers to the CamelContext name, to match on the current CamelContext only. For any other value, the pattern uses the rules from org.apache.camel.support.EndpointHelper#matchPattern(String,String)", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaT [...]
     { "name": "camel.rest.apiContextListing", "description": "Sets whether listing of all available CamelContext's with REST services in the JVM is enabled. If enabled it allows to discover these contexts, if false then only the current CamelContext is in use.", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "boolean", "javaType": "boolean" },
     { "name": "camel.rest.apiContextPath", "description": "Sets a leading API context-path the REST API services will be using. This can be used when using components such as camel-servlet where the deployed web application is deployed using a context-path.", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaType": "java.lang.String" },
diff --git a/core/camel-main/src/main/docs/main.adoc b/core/camel-main/src/main/docs/main.adoc
index cf563e1..cfe4db0 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -177,7 +177,7 @@ The following table lists all the options:
 | *camel.resilience4j.timeout ExecutorServiceRef* | References to a custom thread pool to use when timeout is enabled (uses ForkJoinPool#commonPool() by default) |  | String
 | *camel.resilience4j.wait DurationInOpenState* | Configures the wait duration (in seconds) which specifies how long the CircuitBreaker should stay open, before it switches to half open. Default value is 60 seconds. | 60 | Integer
 | *camel.resilience4j.writable StackTraceEnabled* | Enables writable stack traces. When set to false, Exception.getStackTrace returns a zero length array. This may be used to reduce log spam when the circuit breaker is open as the cause of the exceptions is already known (the circuit breaker is short-circuiting calls). |  | Boolean
-| *camel.rest.apiComponent* | Sets the name of the Camel component to use as the REST API (such as swagger) |  | String
+| *camel.rest.apiComponent* | Sets the name of the Camel component to use as the REST API (such as swagger or openapi) |  | String
 | *camel.rest.apiContextIdPattern* | Optional CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name matches the pattern. The pattern #name# refers to the CamelContext name, to match on the current CamelContext only. For any other value, the pattern uses the rules from org.apache.camel.support.EndpointHelper#matchPattern(String,String) |  | String
 | *camel.rest.apiContextListing* | Sets whether listing of all available CamelContext's with REST services in the JVM is enabled. If enabled it allows to discover these contexts, if false then only the current CamelContext is in use. |  | boolean
 | *camel.rest.apiContextPath* | Sets a leading API context-path the REST API services will be using. This can be used when using components such as camel-servlet where the deployed web application is deployed using a context-path. |  | String
diff --git a/docs/components/modules/others/pages/main.adoc b/docs/components/modules/others/pages/main.adoc
index 490d1dc..b0be766 100644
--- a/docs/components/modules/others/pages/main.adoc
+++ b/docs/components/modules/others/pages/main.adoc
@@ -179,7 +179,7 @@ The following table lists all the options:
 | *camel.resilience4j.timeout ExecutorServiceRef* | References to a custom thread pool to use when timeout is enabled (uses ForkJoinPool#commonPool() by default) |  | String
 | *camel.resilience4j.wait DurationInOpenState* | Configures the wait duration (in seconds) which specifies how long the CircuitBreaker should stay open, before it switches to half open. Default value is 60 seconds. | 60 | Integer
 | *camel.resilience4j.writable StackTraceEnabled* | Enables writable stack traces. When set to false, Exception.getStackTrace returns a zero length array. This may be used to reduce log spam when the circuit breaker is open as the cause of the exceptions is already known (the circuit breaker is short-circuiting calls). |  | Boolean
-| *camel.rest.apiComponent* | Sets the name of the Camel component to use as the REST API (such as swagger) |  | String
+| *camel.rest.apiComponent* | Sets the name of the Camel component to use as the REST API (such as swagger or openapi) |  | String
 | *camel.rest.apiContextIdPattern* | Optional CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name matches the pattern. The pattern #name# refers to the CamelContext name, to match on the current CamelContext only. For any other value, the pattern uses the rules from org.apache.camel.support.EndpointHelper#matchPattern(String,String) |  | String
 | *camel.rest.apiContextListing* | Sets whether listing of all available CamelContext's with REST services in the JVM is enabled. If enabled it allows to discover these contexts, if false then only the current CamelContext is in use. |  | boolean
 | *camel.rest.apiContextPath* | Sets a leading API context-path the REST API services will be using. This can be used when using components such as camel-servlet where the deployed web application is deployed using a context-path. |  | String