在类上加注解: 

@JsonInclude(value = JsonInclude.Include.NON_NULL)

相关文章: