Search in sources :

Example 1 with ProblemModule

use of org.zalando.problem.ProblemModule in project nakadi by zalando.

the class JsonConfig method jacksonObjectMapper.

@Bean
@Primary
public ObjectMapper jacksonObjectMapper() {
    final ObjectMapper objectMapper = new ObjectMapper().setPropertyNamingStrategy(CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
    objectMapper.registerModule(enumModule());
    objectMapper.registerModule(new Jdk8Module());
    objectMapper.registerModule(new ProblemModule());
    objectMapper.registerModule(new JodaModule());
    objectMapper.configure(WRITE_DATES_AS_TIMESTAMPS, false);
    objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    return objectMapper;
}
Also used : Jdk8Module(com.fasterxml.jackson.datatype.jdk8.Jdk8Module) JodaModule(com.fasterxml.jackson.datatype.joda.JodaModule) ProblemModule(org.zalando.problem.ProblemModule) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Primary(org.springframework.context.annotation.Primary) Bean(org.springframework.context.annotation.Bean)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Jdk8Module (com.fasterxml.jackson.datatype.jdk8.Jdk8Module)1 JodaModule (com.fasterxml.jackson.datatype.joda.JodaModule)1 Bean (org.springframework.context.annotation.Bean)1 Primary (org.springframework.context.annotation.Primary)1 ProblemModule (org.zalando.problem.ProblemModule)1