jackson的ObjectMapper忽略大小写与驼峰命名

    @Autowired
    private ObjectMapper mapper;

    mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
    // deprecated  mapper.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
    mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);

发布了259 篇原创文章 · 获赞 118 · 访问量 187万+

猜你喜欢

转载自blog.csdn.net/c5113620/article/details/102851742