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

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

commit 3fd7dd78cad99ad2d777e1b9e331a1b845f26ca7
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Wed Aug 12 13:43:08 2020 +0200

    CAMEL-15400: rest endpoint query parameters should not be marked as 
multivalued.
---
 .../org/apache/camel/component/rest/rest.json      |  2 +-
 .../camel-rest/src/main/docs/rest-component.adoc   |  2 +-
 .../apache/camel/component/rest/RestEndpoint.java  |  6 +++--
 .../endpoint/dsl/RestEndpointBuilderFactory.java   | 27 ++++------------------
 4 files changed, 11 insertions(+), 26 deletions(-)

diff --git 
a/components/camel-rest/src/generated/resources/org/apache/camel/component/rest/rest.json
 
b/components/camel-rest/src/generated/resources/org/apache/camel/component/rest/rest.json
index 27799f9..220266e 100644
--- 
a/components/camel-rest/src/generated/resources/org/apache/camel/component/rest/rest.json
+++ 
b/components/camel-rest/src/generated/resources/org/apache/camel/component/rest/rest.json
@@ -50,7 +50,7 @@
     "host": { "kind": "parameter", "displayName": "Host", "group": "producer", 
"label": "producer", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "secret": false, "description": "Host 
and port of HTTP service to use (override host in openapi schema)" },
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start 
Producer", "group": "producer", "label": "producer", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "secret": false, 
"defaultValue": false, "description": "Whether the producer should be started 
lazy (on the first message). By starting lazy you can use this to allow 
CamelContext and routes to startup in situations where a producer may otherwise 
fail during starting and cause the  [...]
     "producerComponentName": { "kind": "parameter", "displayName": "Producer 
Component Name", "group": "producer", "label": "producer", "required": false, 
"type": "string", "javaType": "java.lang.String", "deprecated": false, 
"secret": false, "description": "The Camel Rest component to use for (producer) 
the REST transport, such as http, 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  [...]
-    "queryParameters": { "kind": "parameter", "displayName": "Query 
Parameters", "group": "producer", "label": "producer", "required": false, 
"type": "string", "javaType": "java.lang.String", "multiValue": true, 
"deprecated": false, "secret": false, "description": "Query parameters for the 
HTTP service to call" },
+    "queryParameters": { "kind": "parameter", "displayName": "Query 
Parameters", "group": "producer", "label": "producer", "required": false, 
"type": "string", "javaType": "java.lang.String", "deprecated": false, 
"secret": false, "description": "Query parameters for the HTTP service to call. 
The query parameters can contain multiple parameters separated by ampersand 
such such as foo=123&bar=456." },
     "basicPropertyBinding": { "kind": "parameter", "displayName": "Basic 
Property Binding", "group": "advanced", "label": "advanced", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, 
"defaultValue": false, "description": "Whether the endpoint should use basic 
property binding (Camel 2.x) or the newer property binding with additional 
capabilities" },
     "synchronous": { "kind": "parameter", "displayName": "Synchronous", 
"group": "advanced", "label": "advanced", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": 
"false", "description": "Sets whether synchronous processing should be strictly 
used, or Camel is allowed to use asynchronous processing (if supported)." }
   }
diff --git a/components/camel-rest/src/main/docs/rest-component.adoc 
b/components/camel-rest/src/main/docs/rest-component.adoc
index e864303..04c06d7 100644
--- a/components/camel-rest/src/main/docs/rest-component.adoc
+++ b/components/camel-rest/src/main/docs/rest-component.adoc
@@ -88,7 +88,7 @@ with the following path and query parameters:
 | *host* (producer) | Host and port of HTTP service to use (override host in 
openapi schema) |  | String
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy 
(on the first message). By starting lazy you can use this to allow CamelContext 
and routes to startup in situations where a producer may otherwise fail during 
starting and cause the route to fail being started. By deferring this startup 
to be lazy then the startup failure can be handled during routing messages via 
Camel's routing error handlers. Beware that when the first message is processed 
then creating and [...]
 | *producerComponentName* (producer) | The Camel Rest component to use for 
(producer) the REST transport, such as http, 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.RestProducerFactory 
is registered in the registry. If either one is found, then that is being used. 
|  | String
-| *queryParameters* (producer) | Query parameters for the HTTP service to call 
|  | String
+| *queryParameters* (producer) | Query parameters for the HTTP service to 
call. The query parameters can contain multiple parameters separated by 
ampersand such such as foo=123&bar=456. |  | String
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic 
property binding (Camel 2.x) or the newer property binding with additional 
capabilities | false | boolean
 | *synchronous* (advanced) | Sets whether synchronous processing should be 
strictly used, or Camel is allowed to use asynchronous processing (if 
supported). | false | boolean
 |===
diff --git 
a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
 
b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
index daba5ec..8357274 100644
--- 
a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
+++ 
b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
@@ -81,7 +81,7 @@ public class RestEndpoint extends DefaultEndpoint {
     private String apiDoc;
     @UriParam(label = "producer")
     private String host;
-    @UriParam(label = "producer", multiValue = true)
+    @UriParam(label = "producer")
     private String queryParameters;
     @UriParam(label = "producer", enums = "auto,off,json,xml,json_xml")
     private RestConfiguration.RestBindingMode bindingMode;
@@ -278,7 +278,9 @@ public class RestEndpoint extends DefaultEndpoint {
     }
 
     /**
-     * Query parameters for the HTTP service to call
+     * Query parameters for the HTTP service to call.
+     *
+     * The query parameters can contain multiple parameters separated by 
ampersand such such as foo=123&bar=456.
      */
     public void setQueryParameters(String queryParameters) {
         this.queryParameters = queryParameters;
diff --git 
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestEndpointBuilderFactory.java
 
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestEndpointBuilderFactory.java
index 870ae41..a4a426e 100644
--- 
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestEndpointBuilderFactory.java
+++ 
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestEndpointBuilderFactory.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.builder.endpoint.dsl;
 
-import java.util.Map;
 import javax.annotation.Generated;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.builder.EndpointConsumerBuilder;
@@ -474,33 +473,17 @@ public interface RestEndpointBuilderFactory {
             return this;
         }
         /**
-         * Query parameters for the HTTP service to call.
+         * Query parameters for the HTTP service to call. The query parameters
+         * can contain multiple parameters separated by ampersand such such as
+         * foo=123&bar=456.
          * 
          * The option is a: <code>java.lang.String</code> type.
-         * The option is multivalued, and you can use the
-         * queryParameters(String, Object) method to add a value (call the
-         * method multiple times to set more values).
          * 
          * Group: producer
          */
         default RestEndpointProducerBuilder queryParameters(
-                String key,
-                Object value) {
-            doSetMultiValueProperty("queryParameters", "null" + key, value);
-            return this;
-        }
-        /**
-         * Query parameters for the HTTP service to call.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * The option is multivalued, and you can use the
-         * queryParameters(String, Object) method to add a value (call the
-         * method multiple times to set more values).
-         * 
-         * Group: producer
-         */
-        default RestEndpointProducerBuilder queryParameters(Map values) {
-            doSetMultiValueProperties("queryParameters", "null", values);
+                String queryParameters) {
+            doSetProperty("queryParameters", queryParameters);
             return this;
         }
     }

Reply via email to