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

mac2025-02-11  12

@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);
最新回复(0)