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

[QUESTION] toJSONString 序列化时默认忽略 private 字段,有没有办法不忽略? #3287

Open
EmptyDreams opened this issue Jan 16, 2025 · 0 comments
Labels
question Further information is requested

Comments

@EmptyDreams
Copy link
Contributor

现在我有这样一个类:

data class Test(
    @JSONField(serialize = true, deserialize = true)
    private val a: Int,
    val b: Int
)

当我使用 Test(1, 2).toJSONString() 序列化类时,a 会被忽略。

默认忽略 private 我认为没有什么问题,但是在主动标注 JSONField 后是否应该优先使用 JSONField 中的设置?

目前版本是否有办法绕过 private 检查?

@EmptyDreams EmptyDreams added the question Further information is requested label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant