Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Configuration
- public class AppConfig {
- @Bean
- public JaxbAnnotationModule jaxbAnnotationModule() {
- return new JaxbAnnotationModule();
- }
- @Bean
- public ObjectMapper objectMapper() {
- ObjectMapper mapper = new ObjectMapper();
- mapper.registerModule(new JaxbAnnotationModule());
- mapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector(mapper.getTypeFactory()));
- mapper.setSerializationInclusion(Include.NON_NULL);
- return mapper;
- }
- }
- @Autowired
- private Validator validator;
- ...Some code...
- Set<ConstraintViolation<Request>> violations = validator.validate(request);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement