JacksonConfiguration.java 522 B

12345678910111213141516171819
  1. package com.sqx.config;
  2. import com.fasterxml.jackson.databind.DeserializationFeature;
  3. import com.fasterxml.jackson.databind.ObjectMapper;
  4. import org.springframework.context.annotation.Bean;
  5. import org.springframework.context.annotation.Configuration;
  6. @Configuration
  7. public class JacksonConfiguration {
  8. @Bean
  9. public ObjectMapper objectMapper() {
  10. ObjectMapper mapper = new ObjectMapper();
  11. mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
  12. return mapper;
  13. }
  14. }