I am new into Play, and I want to try to bind a List of String from a JSON post.
I do the following:
import play.data.validation.Constraints;
import java.util.ArrayList;
import java.util.List;
Form<Person> PERSON = new Form<>(Person.class);
Form<Person> filledForm = PERSON.bind(request().body().asJson());
Person class {
@Constraints.Required
@Constraints.Email
private String email;
@Constraints.Required
private List<String> adresses = new ArrayList<>();
}
I get the following message:
"matches":[
"This field is required"
]