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 2022/11/23 06:45:12 UTC

[camel] 03/03: polished

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

commit 2096e03aef6980fd6707c272f7faedc28c026d93
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Nov 23 07:44:56 2022 +0100

    polished
---
 .../src/main/java/org/apache/camel/spi/RestApiProcessorFactory.java  | 4 ++--
 .../src/main/java/org/apache/camel/spi/RestConfiguration.java        | 5 +++--
 core/camel-api/src/main/java/org/apache/camel/spi/RestRegistry.java  | 5 +++--
 .../resources/META-INF/camel-main-configuration-metadata.json        | 2 +-
 core/camel-main/src/main/docs/main.adoc                              | 2 +-
 .../main/java/org/apache/camel/main/RestConfigurationProperties.java | 5 +++--
 .../apache/camel/api/management/mbean/ManagedRestRegistryMBean.java  | 2 +-
 .../java/org/apache/camel/management/ManagedRestRegistryTest.java    | 2 +-
 8 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/RestApiProcessorFactory.java b/core/camel-api/src/main/java/org/apache/camel/spi/RestApiProcessorFactory.java
index a66554a78a1..f4c2bc80137 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/RestApiProcessorFactory.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/RestApiProcessorFactory.java
@@ -25,8 +25,8 @@ import org.apache.camel.Processor;
  * Allows SPI to plugin a {@link RestApiProcessorFactory} that creates the Camel {@link Processor} responsible for
  * servicing and generating the REST API documentation.
  * <p/>
- * For example the <tt>camel-swagger-java</tt> component provides such a factory that uses Swagger to generate the
- * documentation.
+ * For example the <tt>camel-openapi-java</tt> or <tt>camel-swagger-java</tt> component provides such a factory that
+ * uses OpenAPI/Swagger to generate the documentation.
  */
 public interface RestApiProcessorFactory {
 
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 2f9d04f1ca8..bbe203d6f54 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
@@ -142,8 +142,9 @@ public class RestConfiguration {
 
     /**
      * Sets the location of the api document (swagger api) the REST producer will use to validate the REST uri and query
-     * parameters are valid accordingly to the api document. This requires adding camel-swagger-java to the classpath,
-     * and any miss configuration will let Camel fail on startup and report the error(s).
+     * parameters are valid accordingly to the api document. This requires adding camel-openapi-java, or
+     * camel-swagger-java to the classpath, and any miss configuration will let Camel fail on startup and report the
+     * error(s).
      * <p/>
      * The location of the api document is loaded from classpath by default, but you can use <tt>file:</tt> or
      * <tt>http:</tt> to refer to resources to load from file or http url.
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/RestRegistry.java b/core/camel-api/src/main/java/org/apache/camel/spi/RestRegistry.java
index 74a54b94c78..b3efbc8ba73 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/RestRegistry.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/RestRegistry.java
@@ -141,9 +141,10 @@ public interface RestRegistry extends Service {
     int size();
 
     /**
-     * Outputs the Rest services API documentation in JSON (requires camel-swagger-java on classpath)
+     * Outputs the Rest services API documentation in JSON (requires camel-openapi-java, or camel-swagger-java on
+     * classpath)
      *
-     * @return the API docs in JSon, or <tt>null</tt> if camel-swagger-java is not on classpath
+     * @return the API docs in JSon, or <tt>null</tt> if camel-openapi-java and camel-swagger-java is not on classpath
      */
     String apiDocAsJson();
 
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 e5a838745fd..b9836b00584 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
@@ -196,7 +196,7 @@
     { "name": "camel.rest.inlineRoutes", "description": "Inline routes in rest-dsl which are linked using direct endpoints. By default, each service in Rest DSL is an individual route, meaning that you would have at least two routes per service (rest-dsl, and the route linked from rest-dsl). Enabling this allows Camel to optimize and inline this as a single route, however this requires to use direct endpoints, which must be unique per service. This option is default false.", "sourceType" [...]
     { "name": "camel.rest.jsonDataFormat", "description": "Sets a custom json data format to be used Important: This option is only for setting a custom name of the data format, not to refer to an existing data format instance.", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaType": "java.lang.String" },
     { "name": "camel.rest.port", "description": "Sets the port to use by the REST consumer", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "integer", "javaType": "int" },
-    { "name": "camel.rest.producerApiDoc", "description": "Sets the location of the api document (swagger api) the REST producer will use to validate the REST uri and query parameters are valid accordingly to the api document. This requires adding camel-swagger-java to the classpath, and any miss configuration will let Camel fail on startup and report the error(s). The location of the api document is loaded from classpath by default, but you can use file: or http: to refer to resources t [...]
+    { "name": "camel.rest.producerApiDoc", "description": "Sets the location of the api document (swagger api) the REST producer will use to validate the REST uri and query parameters are valid accordingly to the api document. This requires adding camel-openapi-java, or camel-swagger-java to the classpath, and any miss configuration will let Camel fail on startup and report the error(s). The location of the api document is loaded from classpath by default, but you can use file: or http:  [...]
     { "name": "camel.rest.producerComponent", "description": "Sets the name of the Camel component to use as the REST producer", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaType": "java.lang.String" },
     { "name": "camel.rest.scheme", "description": "Sets the scheme to use by the REST consumer", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaType": "java.lang.String" },
     { "name": "camel.rest.skipBindingOnErrorCode", "description": "Whether to skip binding output if there is a custom HTTP error code, and instead use the response body as-is. This option is default true.", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "boolean", "javaType": "boolean", "defaultValue": true },
diff --git a/core/camel-main/src/main/docs/main.adoc b/core/camel-main/src/main/docs/main.adoc
index 238da3a0b8c..044462aaf6c 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -202,7 +202,7 @@ The camel.rest supports 27 options, which are listed below.
 | *camel.rest.inlineRoutes* | Inline routes in rest-dsl which are linked using direct endpoints. By default, each service in Rest DSL is an individual route, meaning that you would have at least two routes per service (rest-dsl, and the route linked from rest-dsl). Enabling this allows Camel to optimize and inline this as a single route, however this requires to use direct endpoints, which must be unique per service. This option is default false. | false | boolean
 | *camel.rest.jsonDataFormat* | Sets a custom json data format to be used Important: This option is only for setting a custom name of the data format, not to refer to an existing data format instance. |  | String
 | *camel.rest.port* | Sets the port to use by the REST consumer |  | int
-| *camel.rest.producerApiDoc* | Sets the location of the api document (swagger api) the REST producer will use to validate the REST uri and query parameters are valid accordingly to the api document. This requires adding camel-swagger-java to the classpath, and any miss configuration will let Camel fail on startup and report the error(s). The location of the api document is loaded from classpath by default, but you can use file: or http: to refer to resources to load from file or http ur [...]
+| *camel.rest.producerApiDoc* | Sets the location of the api document (swagger api) the REST producer will use to validate the REST uri and query parameters are valid accordingly to the api document. This requires adding camel-openapi-java, or camel-swagger-java to the classpath, and any miss configuration will let Camel fail on startup and report the error(s). The location of the api document is loaded from classpath by default, but you can use file: or http: to refer to resources to lo [...]
 | *camel.rest.producerComponent* | Sets the name of the Camel component to use as the REST producer |  | String
 | *camel.rest.scheme* | Sets the scheme to use by the REST consumer |  | String
 | *camel.rest.skipBindingOnError{zwsp}Code* | Whether to skip binding output if there is a custom HTTP error code, and instead use the response body as-is. This option is default true. | true | boolean
diff --git a/core/camel-main/src/main/java/org/apache/camel/main/RestConfigurationProperties.java b/core/camel-main/src/main/java/org/apache/camel/main/RestConfigurationProperties.java
index 82dc8337817..2e6b2a192eb 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/RestConfigurationProperties.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/RestConfigurationProperties.java
@@ -137,8 +137,9 @@ public class RestConfigurationProperties extends RestConfiguration implements Bo
 
     /**
      * Sets the location of the api document (swagger api) the REST producer will use to validate the REST uri and query
-     * parameters are valid accordingly to the api document. This requires adding camel-swagger-java to the classpath,
-     * and any miss configuration will let Camel fail on startup and report the error(s).
+     * parameters are valid accordingly to the api document. This requires adding camel-openapi-java, or
+     * camel-swagger-java to the classpath, and any miss configuration will let Camel fail on startup and report the
+     * error(s).
      * <p/>
      * The location of the api document is loaded from classpath by default, but you can use <tt>file:</tt> or
      * <tt>http:</tt> to refer to resources to load from file or http url.
diff --git a/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedRestRegistryMBean.java b/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedRestRegistryMBean.java
index d0b8ce43b27..d3f3d22ffb0 100644
--- a/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedRestRegistryMBean.java
+++ b/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedRestRegistryMBean.java
@@ -29,7 +29,7 @@ public interface ManagedRestRegistryMBean extends ManagedServiceMBean {
     @ManagedOperation(description = "Lists all the Rest services in the registry (url, path, verb, consumes, produces)")
     TabularData listRestServices();
 
-    @ManagedOperation(description = "Outputs the Rest services API documentation in JSON (requires camel-swagger-java on classpath)")
+    @ManagedOperation(description = "Outputs the Rest services API documentation in JSON (requires camel-openapi-java, or camel-swagger-java on classpath)")
     String apiDocAsJson();
 
 }
diff --git a/core/camel-management/src/test/java/org/apache/camel/management/ManagedRestRegistryTest.java b/core/camel-management/src/test/java/org/apache/camel/management/ManagedRestRegistryTest.java
index 16ba651efa1..7cac95e194a 100644
--- a/core/camel-management/src/test/java/org/apache/camel/management/ManagedRestRegistryTest.java
+++ b/core/camel-management/src/test/java/org/apache/camel/management/ManagedRestRegistryTest.java
@@ -69,7 +69,7 @@ public class ManagedRestRegistryTest extends ManagementTestSupport {
         TabularData data = (TabularData) mbeanServer.invoke(name, "listRestServices", null, null);
         assertEquals(3, data.size());
 
-        // should not be enabled as api-doc is not enabled or camel-swagger-java is not on classpath
+        // should not be enabled as api-doc is not enabled or camel-openapi-java/camel-swagger-java is not on classpath
         String json = (String) mbeanServer.invoke(name, "apiDocAsJson", null, null);
         assertNull(json);