-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Exclude Part
from nested constructor binding in WebFlux
#31778
Exclude Part
from nested constructor binding in WebFlux
#31778
Conversation
@HeartPattern Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@HeartPattern Thank you for signing the Contributor License Agreement! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please introduce a test that fails before the change and passes after the change?
Part
and MultipartFile
from nested constructor binding on WebFlux
Part
and MultipartFile
from nested constructor binding on WebFluxPart
and MultipartFile
from nested constructor binding in WebFlux
However, it seems like Part and FilePart is not the only problem. Any other nullable types is not bind properly through constructor after ea398d7. For example, in kotlin data class MyBean(
val anotherBean: AnotherBean?,
) Maybe checking |
@HeartPattern, can you please create a separate issue to discuss that? |
Open another PR addressing that problem. |
Class<?> type = param.nestedIfOptional().getNestedParameterType(); | ||
return (super.shouldConstructArgument(param) && | ||
!MultipartFile.class.isAssignableFrom(type) && !Part.class.isAssignableFrom(type)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a necessary change indeed for Part
but MultipartFile
is not used in WebFlux, so we can leave that out.
I'm processing this locally as we are close to the 6.1.2 release. No need send further updates. |
Part
and MultipartFile
from nested constructor binding in WebFluxPart
from nested constructor binding in WebFlux
Related to: #31669 and 9ade52d
WebFlux has same issue with nullable multipart file handling. MultipartFile and Part should be excluded from nested constructor binding in WebExchangeDataBinder.