美文网首页Spring Boot学习
springboot 返回的json中忽略null属性值,不传递

springboot 返回的json中忽略null属性值,不传递

作者: JokerJin | 来源:发表于2019-03-12 15:28 被阅读0次

    第一种:

    @JsonInclude(JsonInclude.Include.NON_NULL)
    

    第二种:

    spring:
      jackson:
        default-property-inclusion: non_null
    

    相关文章

      网友评论

        本文标题:springboot 返回的json中忽略null属性值,不传递

        本文链接:https://www.haomeiwen.com/subject/vmknpqtx.html