We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
使用Map<String, Object>接收参数,使用FastJson2序列化Map<String, Object>设置JSONWriter.Feature.WriteClassName, 以保存原始类类信息,序列化的字符串存储下来,在需要使用时取出反序列化,Map<String, Object>参数中所有value类型恢复为原来的类型
测试发现,对于Object类型可以还原,但是对于数组类型(int[], byte[], List)无法还原出来,反序列化出来为JSONArray,对于无法明确知道用户传入的Object类型时,无法正确转换为对应的类型
测试了Jackson是可以还原的,对于基本类型数组、包装类型数组均可以还原
The text was updated successfully, but these errors were encountered:
FastJson版本2.0.53
Sorry, something went wrong.
No branches or pull requests
使用场景
使用Map<String, Object>接收参数,使用FastJson2序列化Map<String, Object>设置JSONWriter.Feature.WriteClassName, 以保存原始类类信息,序列化的字符串存储下来,在需要使用时取出反序列化,Map<String, Object>参数中所有value类型恢复为原来的类型
问题
测试发现,对于Object类型可以还原,但是对于数组类型(int[], byte[], List)无法还原出来,反序列化出来为JSONArray,对于无法明确知道用户传入的Object类型时,无法正确转换为对应的类型
测试代码
对比验证
测试了Jackson是可以还原的,对于基本类型数组、包装类型数组均可以还原
The text was updated successfully, but these errors were encountered: