Skip to content

java.util.Optional MultipartFile[] @RequestParam argument is null in multipart/form-data POST [SPR-15918] #20472

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Referenced from: commits 15c82af, 53a9697

Backported to: 4.3.12

Metadata

Metadata

Assignees

Labels

status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions