[QUESTION]FastJson2开启autoType数组类型丢失
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 613
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 6
Description
### 使用场景
使用Map接收参数,使用FastJson2序列化Map设置JSONWriter.Feature.WriteClassName, 以保存原始类类信息,序列化的字符串存储下来,在需要使用时取出反序列化,Map参数中所有value类型恢复为原来的类型
### 问题
测试发现,对于Object类型可以还原,但是对于数组类型(int[], byte[], List)无法还原出来,反序列化出来为JSONArray,对于无法明确知道用户传入的Object类型时,无法正确转换为对应的类型
### 测试代码

#### 对比验证
测试了Jackson是可以还原的,对于基本类型数组、包装类型数组均可以还原
Contributor guide
Research direction
Start with the attached test code and reproduce FastJson2 serialization of a Map using JSONWriter.Feature.WriteClassName, then deserialize values including int[], byte[], and List. Compare the result with the Jackson behavior shown in the issue; done means these array and collection values recover their original types instead of becoming JSONArray.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100