Skip to content
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

Request params Optional<List<String> and List<String> are inconsistent [SPR-15676] #20235

Closed
spring-projects-issues opened this issue Jun 16, 2017 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jun 16, 2017

Ayush Kumar opened SPR-15676 and commented

When using List<String> as the request parameter, both key=val1,val2 and key=val1&key=val2 end up mapping to key = [val1, val2]

When using Optional<List<String>> as the request parameter
key=val1,val2 maps to key = Optional([val1,val2])
but key=val1&key=val2 maps to Optional([val1])

This makes RequestParam(..., required = false) List<String> behave differently from RequestParam(...) Optional<List<String>>, which seems unfortunate.


Affects: 4.3.4

Issue Links:

Backported to: 4.3.12

1 votes, 3 watchers

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 16, 2017

Ayush Kumar commented

Linked to #17997

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Sep 20, 2017

Juergen Hoeller commented

This turns out to be addressed by the fix for #20473. I've added dedicated tests for regular parameter values as well now.

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: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants