Changes to validation code to make javax.validation an optional dependency.
This commit is contained in:
@@ -27,9 +27,9 @@ public class RestExporterExampleRestConfig extends RepositoryRestMvcConfiguratio
|
||||
return msgsrc;
|
||||
}
|
||||
|
||||
@Bean public PersonValidator beforeCreatePersonValidator() {
|
||||
return new PersonValidator();
|
||||
}
|
||||
// @Bean public PersonValidator beforeCreatePersonValidator() {
|
||||
// return new PersonValidator();
|
||||
// }
|
||||
|
||||
@Override protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
|
||||
config.addResourceMappingForDomainType(Person.class)
|
||||
|
||||
@@ -29,6 +29,7 @@ public class Person {
|
||||
@Description("A person's first name")
|
||||
private String firstName;
|
||||
@Description("A person's last name")
|
||||
@NotNull
|
||||
private String lastName;
|
||||
@Description("A person's siblings")
|
||||
private List<Person> siblings = Collections.emptyList();
|
||||
@@ -65,7 +66,6 @@ public class Person {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user