the request body contains data as below { "name":"hi", "age":10, "hi":"" }
But In Rest Controller I'm trying to get those data with the help of DTO, RestControllerDTO.class
public RestControllerDTO {
@Notblank private String name;
@Notblank private Integer age;
// getter and setters
}
Now I want to throw an exception as "hi" is an unknown field before entering into the controller class.