Java Obejct 转 Json 在只有get方法的情况下存在问题
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 613
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 6
Description
我发现 当一些复杂的 Object 比如 含有一些get 方法但是没有对应参数的情况下 如果 含有 @Data 的情况fastjson 和 fatsjson2 转出来的String 会有问题 会多出来 get方法对应的那几个参数 如 status buinessType 导致想要转回对象时报错。Gson则没有这个问题,详情请看附件。


Contributor guide
Research direction
No source files or tests are named; start by reconstructing the attached example with a complex object that has getter-only properties and @Data. Compare the fastjson and fastjson2 output with Gson, then verify that the extra getter-derived fields are absent and the JSON can be converted back to the object.
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
- Needs clarification
- Newbie friendliness
- 30/100