I have a DTO class with validation annotations & in a Post API request, I have to take a List of this DTO, but the validations that I have added in the DTO aren't working.
@PostMapping("/test")
public MyTinyDto test(@Valid @RequestBody List<MyTinyDto> myDtos) {
return myDtos.get(0);
}
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MyTinyDto {
@Min(value = 10,
message = "Min value of Integer is ten")
Integer x;
}