-
Notifications
You must be signed in to change notification settings - Fork 459
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
当我entity对象中存在type字段的时候, 反序列化JSONReader.Feature.SupportAutoType. 无法转为我想要的类型 #2604
Comments
@type 属性调整至首位试试 |
还是不行,@type放到首位后. 反序列化回来的对象, 丢失String type字段了 |
|
我找到问题了. 但是没有办法解决... 导致回来的时候, 没有办法反序列化为对应格式了. 这种有什么好办法处理吗 |
`
String str = "[{"type": "STRING11", "@type": "com.miyo.product.qingkong.logic.engine.abstraction.rule.bo.RuleOutputFieldDefinitionBO", "displayName": "_id", "logicalName": "_id"}, {"type": "STRING11", "@type": "com.miyo.product.qingkong.logic.engine.abstraction.rule.bo.RuleOutputFieldDefinitionBO", "displayName": "_desc", "logicalName": "_desc"}, {"type": "INTEGER", "@type": "com.miyo.product.qingkong.logic.engine.abstraction.rule.bo.RuleOutputFieldDefinitionBO", "displayName": "age", "logicalName": "age"}]";
List list3 = (List) JSON.parseObject(str, Object.class,autoTypeFilter,JSONReader.Feature.SupportAutoType,JSONReader.Feature.ErrorOnNotSupportAutoType);
`
简单代码如上. 如果我json中存在了type字段. 就只能反序列化为jsonObject. 而不是我想要的类型了
The text was updated successfully, but these errors were encountered: