title: How to add length restriction in List entries for API model
body: <p>I'm implementing an API model and I need to use a List, but I need the elements in the List to have a max size. Is it possible to create this kind of restriction ? How I can make sure that also each entry in the list will have max size 10 ? Should I do the check in the service before adding in the List or is there some other way ?</p>
  <pre><code>  public class User{     
         
          @Size(max = 10)
          @Schema(description = &quot;User phone number.&quot;)
          private String phoneNumber;
      
          //@Size(max = 10)  I think this will not work for the entries
          @Schema(description = &quot;List - User phone numbers if more than one.&quot;)
          private List&lt;String&gt; phoneNumberList;
      }
  </code></pre>