Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Bean
- public ObjectMapper objectMapper() {
- // ObjectMapper is threadsafe
- // allow convertation to/from Instant
- ObjectMapper mapper = new ObjectMapper().registerModule(new JavaTimeModule());
- // will write as string ISO 8601
- mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
- mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- //mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
- //mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- //mapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, true);
- return mapper;
- }
Advertisement
Add Comment
Please, Sign In to add comment