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

@ModelAttribute name attribute is not supported in WebFlux #28423

Closed
sbrannen opened this issue May 7, 2022 · 0 comments
Closed

@ModelAttribute name attribute is not supported in WebFlux #28423

sbrannen opened this issue May 7, 2022 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented May 7, 2022

While reviewing #28422, I noticed that the name attribute in @ModelAttribute is not supported in WebFlux.

This is because MethodParameter is used instead of SynthesizingMethodParameter when retrieving the @ModelAttribute annotation. In other words, @AliasFor is not honored because the annotation is not synthesized. Consequently, only the value attribute is supported in WebFlux when specifying a custom name via @ModelAttribute.

@sbrannen sbrannen added in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug labels May 7, 2022
@sbrannen sbrannen added this to the 5.3.20 milestone May 7, 2022
@sbrannen sbrannen self-assigned this May 7, 2022
sbrannen added a commit to sbrannen/spring-framework that referenced this issue May 9, 2022
This complements the previous commit which tested only the `name`
attribute.

See spring-projectsgh-28423
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: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant