I have a Spring Boot Controller with an endpoint that accepts the following Configuration class (as json). The class has the param maxIterations and has a @Size annotation set to 9000.
...
import javax.validation.constraints.Max;
import javax.validation.constraints.Size;
public class Configuration {
// Max iterations
@Size(max = 9000)
private Integer maxIterations;
...
}
The problem is that when making the POST call to that endpoint with the following json it does not return an error or warning stating the the maxIterations parameter is higher than 9000.
{
"maxIterations": 15000
}
This is my controller:
@PostMapping()
@ResponseStatus(HttpStatus.CREATED)
public String doSomething(@RequestBody Configuration configuration) {
...
}
What can be the issue?