Bean validation size of a List?

Viewed 55424

How can I set a bean validation constraint that a List should at minimum contain 1 and at maximum contain 10 elements?

None of the following works:

@Min(1)
@Max(10)
@Size(min=1, max=10)
private List<String> list;
2 Answers
Related