Request params Optional<List<String> and List<String> are inconsistent [SPR-15676] #20235
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
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:
@RequestParam
Optional<List<?>> not handling multiple params of the same name correctly ("is duplicated by")@RequestParam
argument is null in multipart/form-data POST@RequestParam
Backported to: 4.3.12
1 votes, 3 watchers
The text was updated successfully, but these errors were encountered: