FastJson/FastJson2 Tips——Serialize NULL<Welcome to comment, collect and exchange>

Common: Use fastjson for processing, such as serialization problems if the field is null. Then @JSONField of fastjson can solve these problems very well.

//fastjson2 设置参数为null时参与序列化
@JSONField(serializeFeatures = JSONWriter.Feature.WriteMapNullValue)
private String userPhone;
//fastjson 设置参数为null时参与序列化
@JSONField(serialzeFeatures = SerializerFeature.WriteMapNullValue)
private String userPhone;

Guess you like

Origin blog.csdn.net/weixin_40097029/article/details/126181176