You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Zoran Regvart (Jira)" <ji...@apache.org> on 2019/11/08 17:40:00 UTC

[jira] [Updated] (CAMEL-14163) Support for multiple request query parameters in Rest component

     [ https://issues.apache.org/jira/browse/CAMEL-14163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zoran Regvart updated CAMEL-14163:
----------------------------------
    Description: 
The RestProducer doesn't have a way for specifying multiple query parameters. Given a header value that's a collection of values the resulting query parameter will be a joining of those values with the comma separator.

Given that the query parameter can be specified multiple times, it is more common to have the parameter specified for each value of the collection rather than a single parameter with the coma-separated list of values.

For example, endpoint URI of {{rest:GET:/v2/:pet/findByStatus}} and endpoint property {{queryParameters}} set to {{status={status}}}, and on the message header the {{status}} is a collection or array of values (e.g. {{["available", "pending"]}}), the resulting URI path will be {{/v2/pet/findByStatus?status=available,pending}}.

I think we could extemd the syntax of the placeholder (the {{{status}}}) to indicate that multiple query parameters should be provided instead of the coma-separated values.

Perhaps something like {{status={status*}}} as we already have {{status={status?}}} to signify optional parameters. This would generate the URI path as {{/v2/pet/findByStatus?status=available&status=pending}}.

  was:
The RestProducer doesn't have a way for specifying multiple query parameters. Given a header value that's a collection of values the resulting query parameter will be a joining of those values with the comma separator.

Given that the query parameter can be specified multiple times, it is more common to have the parameter specified for each value of the collection rather than a single parameter with the coma-separated list of values.

For example, endpoint URI of {{rest:GET:/v2/:pet/findByStatus}} and endpoint property {{queryParameters}} set to {{status=\{status\}}}, and on the message header the {{status}} is a collection or array of values (e.g. {{["available", "pending"]}}), the resulting URI will be {{/v2/pet/findByStatus?status=available,pending}}.

I think we could extemd the syntax of the placeholder (the {{\{status\}}}) to indicate that multiple query parameters should be provided instead of the coma-separated values.

Perhaps something like {{status=\{status*\}}} as we already have {{status=\{status?\}}} to signify optional parameters.


> Support for multiple request query parameters in Rest component
> ---------------------------------------------------------------
>
>                 Key: CAMEL-14163
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14163
>             Project: Camel
>          Issue Type: Improvement
>          Components: rest
>    Affects Versions: 2.18.0
>            Reporter: Zoran Regvart
>            Assignee: Zoran Regvart
>            Priority: Major
>
> The RestProducer doesn't have a way for specifying multiple query parameters. Given a header value that's a collection of values the resulting query parameter will be a joining of those values with the comma separator.
> Given that the query parameter can be specified multiple times, it is more common to have the parameter specified for each value of the collection rather than a single parameter with the coma-separated list of values.
> For example, endpoint URI of {{rest:GET:/v2/:pet/findByStatus}} and endpoint property {{queryParameters}} set to {{status={status}}}, and on the message header the {{status}} is a collection or array of values (e.g. {{["available", "pending"]}}), the resulting URI path will be {{/v2/pet/findByStatus?status=available,pending}}.
> I think we could extemd the syntax of the placeholder (the {{{status}}}) to indicate that multiple query parameters should be provided instead of the coma-separated values.
> Perhaps something like {{status={status*}}} as we already have {{status={status?}}} to signify optional parameters. This would generate the URI path as {{/v2/pet/findByStatus?status=available&status=pending}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)