Jackson 反序列化時 大小寫不敏感設置

經常使用配置
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(Feature.IGNORE_UNKNOWN,true);
objectMapper.configure(Feature.WRITE_BIGDECIMAL_AS_PLAIN,true);
objectMapper.configure(JsonParser.Feature.ALLOW_MISSING_VALUES,true);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES,false);//大小寫脫敏 默認爲false  須要改成true

參考java

com.fasterxml.jackson.databind.MapperFeature#ACCEPT_CASE_INSENSITIVE_PROPERTIESapp

相關文章
相關標籤/搜索