Skip to content

provide .queryParam(String name, Collection<?> items) to provide multiValued query parameters #23114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bjconlan-fc opened this issue Jun 12, 2019 · 2 comments
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: superseded An issue that has been superseded by another type: enhancement A general enhancement

Comments

@bjconlan-fc
Copy link

bjconlan-fc commented Jun 12, 2019

When using the UrlBuilder (via the WebClient) you can pass a collection as the query parameter value like:

webClient.get().uri(uriBuilder -> uriBuilder.path("/find")
  .queryParam("items", List.of("dogs", "cats"))                   // <!-- this
  .build()

This doesn't generate the expected 'multivalued' query param (ie ?items=dogs&items=cats or ?items=dogs,cats).

It would be good if it were possible to do something like this.

NOTE: .queryParam(String name, Object... varargs) does solve this problem, but having 1st class collection support would be much nicer than shimming things to work with this (or using StringUtils.collectionToDelimitedString(List.of("dogs", "cats"), ",")).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 12, 2019
@sbrannen sbrannen added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels Jun 12, 2019
@nosan
Copy link
Contributor

nosan commented Jun 12, 2019

May I take this issue?

nosan added a commit to nosan/spring-framework that referenced this issue Jun 12, 2019
UriBuilder.replaceQueryParams(name, Collection<?> values) methods
to provide `multiValued` query parameters.

spring-projectsgh-23114
@rstoyanchev rstoyanchev added this to the 5.2 RC1 milestone Jun 17, 2019
@rstoyanchev rstoyanchev removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 17, 2019
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Jun 17, 2019

Superseded by pull request #23119.

@rstoyanchev rstoyanchev removed this from the 5.2 RC1 milestone Jun 17, 2019
@rstoyanchev rstoyanchev added the status: superseded An issue that has been superseded by another label Jun 17, 2019
rstoyanchev pushed a commit that referenced this issue Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: superseded An issue that has been superseded by another type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants