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
{ "podConfigPackageList": [ { "priceId": 65, "originalPrice": 46, "presentPrice": 88 }, { "priceId": 88, "originalPrice": 93, "presentPrice": 55 } ] }
反序列化报错。依赖库如下:
<dependency> <groupId>com.alibaba.fastjson2</groupId> <artifactId>fastjson2</artifactId> <version>2.0.44</version> </dependency> <!-- https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2-extension-spring5 --> <dependency> <groupId>com.alibaba.fastjson2</groupId> <artifactId>fastjson2-extension-spring5</artifactId> <version>2.0.44</version> </dependency>
报错信息如下:
Caused by: com.alibaba.fastjson2.JSONException: illegal fieldName input6, offset 69, character 6, line 4, column 26, fastjson-version 2.0.44 { "podConfigPackageList": [ { "priceId": 65, "originalPrice": 46, "presentPrice": 88 }, { "priceId": 88, "originalPrice": 93, "presentPrice": 55 } ] } at com.alibaba.fastjson2.JSONReaderUTF8.readFieldNameHashCode(JSONReaderUTF8.java:2676) at com.alibaba.fastjson2.reader.ORG_3_10_PodConfig.readObject(Unknown Source) at com.alibaba.fastjson2.reader.ORG_2_8_PodConfigPackage.readObject(Unknown Source) at com.alibaba.fastjson2.reader.ORG_1_9_PodConfigPackageVO.readObject(Unknown Source) at com.alibaba.fastjson2.JSON.parseObject(JSON.java:1486) at com.alibaba.fastjson2.support.spring.http.converter.FastJsonHttpMessageConverter.readType(FastJsonHttpMessageConverter.java:111) ... 113 common frames omitted
The text was updated successfully, but these errors were encountered:
后面我用字符串接收转换后,测试完成。 我又用list测试了一次,又没问题了。 很奇怪,不知道什么问题。
Sorry, something went wrong.
你要把对应的 Java 实体类 也贴出来,光给一个 JSON 字符串,很难定位问题所在。 你不一定要给项目中实际用到的,只要给一个能够复现该问题的 Demo 代码即可。
非常抱歉,定位到问题了,使用了lombok插件,对其中的一个字段set方法做了自定义,导致解析异常。 库没有问题,非常抱歉
没事的,感谢反馈
No branches or pull requests
反序列化报错。依赖库如下:
报错信息如下:
The text was updated successfully, but these errors were encountered: