I have defined a rest endpoint method as:
@GetMapping("/get")
public ResponseEntity getObject(@Valid MyObject myObject){....}
This maps request parameters to MyObject.
MyObject is defined as(with lombok, javax.validation annotations):
@Value
@AllArgsConstructor
public class MyObject {
@Min(-180) @Max(180)
private double x;
@Min(-90) @Max(90)
private double y;
}
But validations are not working. Even with values out of prescribed range, request doesn't throw error and goes well.