-
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
Document explicit @ModelAttribute
is required for reflection hints inference
#31765
Comments
You can reproduce it by |
There's a @RequestMapping("/demo")
public String demo(@RequestBody TestDto dto){
// ... |
It's intentional, then parameters from request will be used instead of request body. |
@mhalbritter I want use get request and url parameters like http://127.0.0.1:8080/demo?name=test not post request. This |
If you change return type from public TestDto demo(TestDto dto){
return dto;
} It works both with |
Sorry, my bad. Then this looks like a bug to me. |
I suspect it's a bug/limitation of Framework's |
I agree, this belongs to Spring Framework. Workaround: Annotate your main class with |
This is a known and almost "by design" limitation of As a consequence, I suggest that we recommend and document for GraalVM use case explicit annotation with As discussed with @mhalbritter, I suggest we add in the web section of Spring Boot GraalVM wiki:
I will also update those Spring Framework reference pages to document that limitation. |
@ModelAttribute
is required for reflection hints inference
I've updated the wiki page on Spring Boot side. |
code https://github.com/xuyixun/demo-graalvm-java
spring boot: 3.2.0
gradle: 8.5
Hi Spring Team,I run Demo with
gradle bootRun
is fine. Then build Demo withgradle bootBuildImage
is fine. But when run docker image and request 127.0.0.1:8080/demo or http://127.0.0.1:8080/demo?name=test with error causesThe text was updated successfully, but these errors were encountered: