springboot 空值不返回
文章目录
1、全局配置
spring.jackson.default-property-inclusion=non_null2、局部使用
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OrderTransport {
private String name;
private Integer age;
}1、全局配置
spring.jackson.default-property-inclusion=non_null2、局部使用
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OrderTransport {
private String name;
private Integer age;
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论