You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
我在反序列化不同子类对象时给typeKey配置一个自定义字段“aniType”,
如果aniType是String类型时,运行下面test()方法运行正常,可以得到正确的子对象;
如果aniType是Int类型时,运行下面test()方法直接报错
com.alibaba.fastjson2.JSONException: No suitable ObjectReader found foraniType, offset 12, character 1, line 1, column 13, fastjson-version 2.0.32 {"aniType":1,"dogName":"dog1001"}
我在反序列化不同子类对象时给typeKey配置一个自定义字段“aniType”,
如果aniType是String类型时,运行下面test()方法运行正常,可以得到正确的子对象;
如果aniType是Int类型时,运行下面test()方法直接报错
com.alibaba.fastjson2.JSONException: No suitable ObjectReader found foraniType, offset 12, character 1, line 1, column 13, fastjson-version 2.0.32 {"aniType":1,"dogName":"dog1001"}
请问aniType为Int类型时,需要如何配置可以正常解析?
The text was updated successfully, but these errors were encountered: