我想避免必须在属性前面加上@JsonProperty("property_name")
,而只需设置Spring WebClient构建器即可将所有snake_cases转换为camelCases。
有可能吗?
您可以在模型类中添加注释:
@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
public class Model {
String camelCase; //will be camel_case in json
}