Closed smals-mavh closed 1 month ago
This is a BeanValidation constraint violation. I don't believe the name originates from the @PathVariable("name")
annotation itself. AFAIK it originates from the parameter name in the class file, via reflection. This was introduced in Java 8, but requires a compiler flag "-parameters".
https://docs.oracle.com/en/java/javase/21/docs/specs/man/javac.html#option-parameters
Or <parameters>true</parameters>
in the maven-compiler-plugin configuration.
https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#parameters
If I disable
I get similar failures with "arg0" in the integration tests.
That being said, it would probably be better if the parameter name could be extracted from annotations like PathVariable, RequestParam and RequestHeader. The name of the java method param does not necessarily match the name in the annotation.
This should be achievable with a ParameterNameProvider.
Got the following response from a Spring Boot 3.3.3 application:
Parameter annotations are only present on the (generated) interface, not on the implementation (when adding annotation to the implementation, 'name' is filled in correctly). Probably something goes wrong in reading the annotations of the parent class / interface.