Skip to content

Conversation

@remeio
Copy link
Contributor

@remeio remeio commented Jan 23, 2025

When expand /hello?name={name}:

  1. with uriVariables map:
  • name: new String[]{"foo", "bar"}

We will get /hello?name=foo,bar.

  1. with uriVariables map:
  • name: List.of("foo", "bar")
  • Or other Collection.

We will get /hello?name=[foo, bar].

This PR will keep the same behavior for array and collection when expanding query parameter.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 23, 2025
@rstoyanchev rstoyanchev added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Feb 3, 2025
@rstoyanchev
Copy link
Contributor

This was added some time ago in #14346, but indeed no reason it shouldn't work for collections, which otherwise would be formatted with square brackets.

@rstoyanchev rstoyanchev self-assigned this Feb 3, 2025
@rstoyanchev rstoyanchev added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Feb 3, 2025
@rstoyanchev rstoyanchev added this to the 7.0.0-M2 milestone Feb 3, 2025
@rstoyanchev rstoyanchev changed the title Keep the same behavior for array and collection when expanding query parameter Support formatting of Collection URI template variables in UriComponentsBuilder Feb 3, 2025
@rstoyanchev rstoyanchev changed the title Support formatting of Collection URI template variables in UriComponentsBuilder HierarchicalUriComponents should format Collection URI var values in query param Feb 11, 2025
rstoyanchev pushed a commit that referenced this pull request Feb 12, 2025
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) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants