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? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
简要描述您碰到的问题。 JSON对于数组序列化后再反序列化对象类型错误 TestER te=new TestER(); te.setName("ER"); List<TestER[]> list1=new ArrayList<TestER[]>(); list1.add(new TestER[] {te,te}); list1.add(new TestER[] {te,te}); byte[] by1= JSON.toJSONBytes(list1,JSONWriter.Feature.WriteClassName ); Object tob1=JSON.parseObject(by1, list1.getClass(), JSONReader.autoTypeFilter("grpc") ); tob1对象的类属性为。ArrayList.JSONArray.JSONObject
TestER te=new TestER(); te.setName("ER"); List<TestER[]> list1=new ArrayList<TestER[]>(); list1.add(new TestER[] {te,te}); list1.add(new TestER[] {te,te}); byte[] by1= JSON.toJSONBytes(list1,JSONWriter.Feature.WriteClassName ); Object tob1=JSON.parseObject(by1, list1.getClass(), JSONReader.autoTypeFilter("grpc") );
JSONB 可以正常反序列化对象
请填写以下信息:
如何操作可以重现该问题: 如上代码
对您期望发生的结果进行清晰简洁的描述。 JSONB一样处理
请复制并粘贴任何相关的日志输出。
如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。
The text was updated successfully, but these errors were encountered:
类型丢失了
Sorry, something went wrong.
fix WriteClassName does not work well on arrays, for issue alibaba#2175
f8204dc
fix WriteClassName does not work well on arrays, for issue #2175
30673e4
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.46-SNAPSHOT/ 问题已修复,请帮忙用2.0.46-SNAPSHOT版本验证,正式版本预计在3月初发布。
https://github.com/alibaba/fastjson2/releases/tag/2.0.46 问题已修复,请用新版本
No branches or pull requests
问题描述
简要描述您碰到的问题。
JSON对于数组序列化后再反序列化对象类型错误
TestER te=new TestER(); te.setName("ER"); List<TestER[]> list1=new ArrayList<TestER[]>(); list1.add(new TestER[] {te,te}); list1.add(new TestER[] {te,te}); byte[] by1= JSON.toJSONBytes(list1,JSONWriter.Feature.WriteClassName ); Object tob1=JSON.parseObject(by1, list1.getClass(), JSONReader.autoTypeFilter("grpc") );
tob1对象的类属性为。ArrayList.JSONArray.JSONObject
JSONB 可以正常反序列化对象
环境信息
请填写以下信息:
重现步骤
如何操作可以重现该问题:
如上代码
期待的正确结果
对您期望发生的结果进行清晰简洁的描述。
JSONB一样处理
相关日志输出
请复制并粘贴任何相关的日志输出。
附加信息
如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。
The text was updated successfully, but these errors were encountered: