We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
toJSONString() 时似乎会忽略 Boolean 类型的属性
请填写以下信息:
@Test fun testToJSONString(){ data class BackupMMKV(val mmkvKey: String, val mmkvValue: Boolean) val mmkvList = mutableListOf<BackupMMKV>() mmkvList.add(BackupMMKV("test1",true)) mmkvList.add(BackupMMKV("test2",false)) val json = mmkvList.toJSONString() println(json) }
[{"mmkvKey":"test1","mmkvValue":true},{"mmkvKey":"test2","mmkvValue":false}]
[{"mmkvKey":"test1"},{"mmkvKey":"test2"}]
将 mmkvValue 修改为 Int 类型的话,是可以正常包含在输出的 Json 里的
Int
The text was updated successfully, but these errors were encountered:
似乎会因为未知原因吞掉 mmkvValue 这个字段名,我顺手改成 isSuccess 后能输出了……不过是 success
success
Sorry, something went wrong.
Merge pull request #590 from kraity/main
a2d6849
fix: serialization of boolean type (Getter) in kotlin #587
fix: serialization of boolean type (Getter) #587
419a2a3
https://github.com/alibaba/fastjson2/releases/tag/2.0.11 问题已修复,请用新版本
No branches or pull requests
问题描述
toJSONString() 时似乎会忽略 Boolean 类型的属性
环境信息
请填写以下信息:
重现步骤
期待的正确结果
实际输出
额外
将 mmkvValue 修改为
Int
类型的话,是可以正常包含在输出的 Json 里的The text was updated successfully, but these errors were encountered: