Support name attribute in @ModelAttribute in WebFlux
Prior to this commit, the `name` attribute in @ModelAttribute was not supported when using WebFlux. This is because MethodParameter was used instead of SynthesizingMethodParameter when retrieving the @ModelAttribute annotation. In other words, @AliasFor was not honored because the annotation was not synthesized. Consequently, only the `value` attribute was supported in WebFlux when specifying a custom name via @ModelAttribute. This commit fixes this by using SynthesizingMethodParameter to retrieve the @ModelAttribute annotation. Closes gh-28423
This commit is contained in:
@@ -180,7 +180,7 @@ class ErrorsMethodArgumentResolverTests {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
void handleWithCustomModelAttributeName(
|
||||
@ModelAttribute("custom") Foo foo,
|
||||
@ModelAttribute(name = "custom") Foo foo,
|
||||
Errors errors,
|
||||
@ModelAttribute Mono<Foo> fooMono,
|
||||
BindingResult bindingResult,
|
||||
|
||||
Reference in New Issue
Block a user