@Configuration public class JacksonConfiguration {
/** * Support for Java date and time API. * @return the corresponding Jackson module. */ @Bean public JavaTimeModule javaTimeModule() { return new JavaTimeModule(); }
@Bean public Jdk8Module jdk8TimeModule() { return new Jdk8Module(); }
@Bean @Primary @ConditionalOnMissingBean(ObjectMapper.class) public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) { ObjectMapper objectMapper = builder.createXmlMapper(false).build(); SimpleModule simpleModule = new SimpleModule(); simpleModule.addSerializer(Record.class,new RecordJackSonSerializer()); objectMapper.registerModule(simpleModule);