-
Notifications
You must be signed in to change notification settings - Fork 510
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
[BUG]public修饰的首字母大写的字段,序列化重复key生成 #3220
Comments
@cloudlessa 因为你的字段UserName,不是标准的驼峰命名的原因
@JSONField(name = "UserName")
public String UserName;
public String userName; |
序列化时,会同时查找方法和字段
|
这两个都不能用诶,因为这个是用的sdk里面的包,没办法修改 |
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.54-SNAPSHOT/ |
fastjson2-2.0.54-20250102.033302-13.jar这个版本可以了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
简要描述您碰到的问题。
首字母大写的字段,序列化重复key生成
环境信息
请填写以下信息:
重现步骤
如何操作可以重现该问题:
当字段首字母大写,并且用public修饰的时候,生成的json字符串key会重复,如下:
期待的正确结果
对您期望发生的结果进行清晰简洁的描述。
相关日志输出
请复制并粘贴任何相关的日志输出。
附加信息
如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。
The text was updated successfully, but these errors were encountered: