0
点赞
收藏
分享

微信扫一扫

SpringBoot值为null的数据不返回【Spring.jackson】

路西法阁下 2022-01-09 阅读 38

1、使用注解

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
	@TableField(exist = false)
    private List<CategoryEntity> children;

2、在yum文件里面配置
一个个注解是很麻烦的,我们可以在yml文件里面进行配置

spring:
    jackson:
    	default-property-inclusion: NON_EMPTY
举报

相关推荐

0 条评论