对象序列化后属性名被修改(驼峰转换错误)
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 613
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 6
Description
版本2.0.21
重现代码:
@Data
public class MyUser {
private String oAuthName;
private Integer age;
public static void main(String[] args) {
MyUser myUser = new MyUser();
myUser.setOAuthName("xiong");
myUser.setAge(25);
System.out.println(JSON.toJSONString(myUser));
// 期望输出为: {"oAuthName":"xiong","age":25}
// 实际输出为: {"OAuthName":"xiong","age":25}
}
}
Contributor guide
Research direction
Start by running the provided MyUser reproduction with fastjson2 version 2.0.21 and inspect the serialization path for the oAuthName field. Done means serialization preserves the expected property name "oAuthName" while continuing to output age correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100