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

Support for java.util.Optional as a @RequestPart [SPR-12644] #17245

Closed
spring-projects-issues opened this issue Jan 19, 2015 · 1 comment
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jan 19, 2015

Anderson Vaz opened SPR-12644 and commented

In issue #16448 was introduced support for java.util.Optional for @ResquestParam Controllers method parameters however it was not spread to @RequestPart parameters.
Attached is a project Spring Boot demonstrating the issue. When the parameter is @RequestPart and Optional, Spring can't convert the value.

I think that would be nice to have this feature implemented for @RequestPart parameters too.

Thanks!


Affects: 4.1.3, 4.1.4

Reference URL: https://github.com/avaz/spring-bug-optional-requestpart.git

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

This turns out to be rather involved due to all the parameter type variants of @RequestPart, including the need to delegate to the registered HttpMessageConverters with a nested parameter type (which the infrastructure wasn't prepared for yet). So I'll keep it as a 4.2 feature, to be available in the next 4.2 snapshot tomorrow, going through the 4.2 RC phase.

Juergen

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) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants