springboot 忽略null属性值,不传递

第一种:

@JsonInclude(JsonInclude.Include.NON_NULL)

第二种:

spring:
  jackson:
    default-property-inclusion: non_null

  

原文地址:https://www.cnblogs.com/412013cl/p/10469975.html