Skip to content

@RequestParam Optional<List<?>> not handling multiple params of the same name correctly [SPR-15857] #20412

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
spring-projects-issues opened this issue Aug 9, 2017 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Aug 9, 2017

Cole Snodgrass opened SPR-15857 and commented

A @RequestParam Optional<List<String>> param will only return the first element if the param is specified multiple times in the query-string.

e.g.
?param=a,b,c will return the expected value but ?param=a&param=b&param=c will not

This is inconsistent with @RequestParam List<String>> param behavior. I have a workaround by using @RequestParam(required = false) List<String> param but this is not ideal.


Affects: 4.3.9

Reference URL: https://gist.github.com/cole-snodgrass/1e6270d4007841af8cff082e2aac8316

Issue Links:

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: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants