2

How can I validate the length of the elements inside a list with javax.validation?

@Size(min = 2, max = 3)
private String value;

private List<String> list;
membersound
  • 81,582
  • 193
  • 585
  • 1,120
  • I think you should read [this](http://stackoverflow.com/questions/4308224/hibernate-validation-of-collections-of-primitives) topic and all of those solutions. – cieplik Jul 26 '16 at 15:13

1 Answers1

-1

hibernate-validator 5.2.x will be supporting the following syntax, which is great:

List<@Length(min = 2, max = 3) String> list;

membersound
  • 81,582
  • 193
  • 585
  • 1,120