json序列化空的时候显示出来

发布时间 2023-07-25 15:47:53作者: 悄悄的来,匆匆的走
@JsonInclude(JsonInclude.Include.ALWAYS)


期望转换后的json字符串应该为:

{"id":1200,"name":null,"createDate":15622858066864}

实际转换的json为:

{"id":1200,"createDate":15622858066864}

在转换的类上加@JsonInclude(JsonInclude.Include.ALWAYS)