response响应字段为空时,出现这个错误。
出现原因经过查阅应该是由于要序列化的数据是个空对象。
可以在该类上加注解
@JsonInclude(JsonInclude.Include.NON_NULL )
//@JsonInclude其他用法说明
@JsonInclude(JsonInclude.Include.ALWAYS) 默认
@JsonInclude(JsonInclude.Include.NON_DEFAULT ) 属性为默认值不序列化
@JsonInclude(JsonInclude.Include.NON_EMPTY ) 属性为空("") 或者为 NULL 都不序列化
@JsonInclude(JsonInclude.Include.NON_NULL ) 属性为NULL 不序列化