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 by transcribing and running the test code shown in the issue, focusing on Map serialization with JSONWriter.Feature.WriteClassName and subsequent deserialization. Trace how Object values differ from int[], byte[], and List; done means these array and collection values are restored to their original types rather than becoming JSONArray instances.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100