Closed
Description
Brice Roncace opened SPR-15918 and commented
If an Optional
@RequestParam
is not present in the request parameters, that value should be Optional.EMPTY
as opposed to null
. However, an Optional<MultipartFile[]>
or Optional<List<MultipartFile>>
parameter on a controller method handling a POSTed multipart/form-data request is NOT converting that parameter to Optional.EMPTY as expected but leaving it null
.
Affects: 4.3.10
Reference URL: https://stackoverflow.com/q/45949393/225217
Issue Links:
- Request params Optional<List<String> and List<String> are inconsistent [SPR-15676] #20235 Request params Optional<List and List are inconsistent
- Empty List instead of null in List<MultipartFile> files [SPR-16329] #20876 Empty List instead of null in List files
- only one MultipartFile object populated when using an java.util.Optional MutipartFile array or list @RequestParam [SPR-15919] #20473 only one MultipartFile object populated when using an java.util.Optional MutipartFile array or list
@RequestParam
Referenced from: commits 15c82af, 53a9697
Backported to: 4.3.12