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? 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
如果第三方接口返回的是:
[ { "name": "张三", "position": "语文", "age": 15, "class": 1 }, { "name": "张三2", "position": "语文2", "age": 15, "class": 1 } ]
这种数组结构的json,则系统解析会报错,出错原因是 这部分代码: Map<String,Object> map = JsonSerializeHelper.deserialize(resultContent, Map.class);反序列化错误;
Map<String,Object> map = JsonSerializeHelper.deserialize(resultContent, Map.class);
The text was updated successfully, but these errors were encountered:
问题描述 如果第三方接口返回的是: [ { "name": "张三", "position": "语文", "age": 15, "class": 1 }, { "name": "张三2", "position": "语文2", "age": 15, "class": 1 } ] 这种数组结构的json,则系统解析会报错,出错原因是 这部分代码: Map<String,Object> map = JsonSerializeHelper.deserialize(resultContent, Map.class);反序列化错误;
这里是由于接口结构不确定导致的,实际接口定义过程中,一般接口还会有接口状态码,接口错误信息等统一参数,因此这种情况在实际开发中,属于少数情况,我们目前还没有想到非常优雅的解决方案,有好的方案后会修复
Sorry, something went wrong.
数组结构怎么能转换成map呢, 一个是多个对象的集合,一个是单个对象
具体希望从什么样的数组转换成什么样的map,可以给个示例,目前通过代码节点是可以任意转换的
No branches or pull requests
问题描述
如果第三方接口返回的是:
这种数组结构的json,则系统解析会报错,出错原因是 这部分代码:
Map<String,Object> map = JsonSerializeHelper.deserialize(resultContent, Map.class);
反序列化错误;The text was updated successfully, but these errors were encountered: