-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
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
[FEATURE]fastjson2.0.6反序列化Boolean时的兼容问题 #429
Labels
enhancement
New feature or request
Milestone
Comments
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.7-SNAPSHOT/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
请描述您的需求或者改进建议
代码如下:属性d为Boolean类型;当我转成对象的时候:由于d为空字符串,所以报错
String ss ="{"a":null,"b":"","c":[],"d":"","date":"2022-06-07"}";
System.out.println(JSON.parseObject(ss,Entity.class));
描述您考虑过的替代方案
1.x版本是可以把这个进行过滤掉的;;2.x是否考虑也是如此?
附加信息
Exception in thread "main" com.alibaba.fastjson2.JSONException: can not convert to boolean :
at com.alibaba.fastjson2.JSONReader.readBoolValue(JSONReader.java:1333)
at com.alibaba.fastjson2.JSONReader.readBool(JSONReader.java:1266)
at com.alibaba.fastjson2.reader.FieldReaderBoolMethod.readFieldValue(FieldReaderBoolMethod.java:19)
at com.alibaba.fastjson2.reader.ObjectReader5.readObject(ObjectReader5.java:300)
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:421)
at FastJsonTest.main(FastJsonTest.java:30)
The text was updated successfully, but these errors were encountered: