Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

序列化保留 #8

Closed
cjhxajh opened this issue Apr 8, 2022 · 2 comments
Closed

序列化保留 #8

cjhxajh opened this issue Apr 8, 2022 · 2 comments

Comments

@cjhxajh
Copy link

cjhxajh commented Apr 8, 2022

对于字段/属性而言,如果其值为null,false或0,那么为了性能考虑将不会对该字段/属性进行序列化
JsonParser.ToJson 时能加个开关保留 其值为null,false或0 的字段或属性吗
某些情况下可能会用到,比如导出一些游戏设置后,我想要手动把值为false改为true的时,这个字段没了。。还得手动把字段名加上

@CatImmortal
Copy link
Owner

已经增加忽略默认值序列化的开关:JsonParser.IgnoreDefaultValue

@cjhxajh
Copy link
Author

cjhxajh commented Apr 9, 2022

猫佬牛B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants