Affects: 6.0.3
Given a simple validated controller:
@Validated
@RestController
class Controller {
@ResponseStatus(HttpStatus.OK)
@GetMapping("/list")
Flux<Object> list(@Min(1) @Max(100) @RequestParam short limit) {
return Flux.just("one", "two");
}
}
The ConstraintViolationException message says "list.arg0: must be greater than or equal to 1". It should be list.limit instead of limit.arg0. I suspect it related to the LocalVariableTableParameterNameDiscoverer.
Comment From: singhbaljit
Adding the compiler flag fixed the problem:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>