Skip to content

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

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions