alibaba / fastjson

FASTJSON 2.0.x has been released, faster and more secure, recommend you upgrade.
https://github.com/alibaba/fastjson2/wiki/fastjson_1_upgrade_cn
Apache License 2.0
25.73k stars 6.5k forks source link

实体转json,字段值为null,可以转换成自定义值吗 #2004

Open COBSNAN opened 6 years ago

COBSNAN commented 6 years ago

类似WriteNullNumberAsZero,如果Number类型的值是null,用0替换,现在需要替换一个自定义的值吗? 用@JSONField 的serializeUsing 属性来修改序列化方法,但为null的值根本不走到这个方法。

ansiz commented 4 years ago

这问题没人解决么?有啥好的别的办法吗?

hanchenfei-afei commented 4 years ago

遇到同样的问题,有解决吗?