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);

你可能感兴趣的:(java)