json - JSON:预计解码字典但找到了一个字符串/数据
问题描述
下面是 json 响应片段:
"hp": "130",
"types": [
"Lightning"
],...
这是我的可解码模型片段:
struct Pokemon: Decodable {
let hp: String?
let types: [Types]?
}
struct Types: Decodable {
let types: String
}
这篇文章的标题是我得到的错误。我已经尽我所能,但仍然无法修复错误。非常感谢
解决方案
推荐阅读
- html - 如何将自定义元素与模板一起使用?
- python - 用辅助轴绘制 2 条线,但不显示第一列数据
- r - 对从命令行 (optparse) R 传递参数感到困惑,即使使用显式“默认”选项也不会存储参数
- php - 注意:第 6 行中的数组到字符串的转换!关于 SQL 的问题
- r-markdown - RMarkdown 到 PPT:未加载 reference_doc()
- c - 无法制作:函数“http_write_chunked”的隐式声明
- nestjs - Nestjs 服务器不为 socket.io 客户端提供服务
- mysql - mysql select查询不适用于通过用户变量设置的限制和偏移量
- mysql - mariadb vs mysql * 两者如何处理 SELECT * FROM Customers WHERE City LIKE '[acs]%';
- javascript - 从类 ajaxSuccess 事件侦听器方法指向类“this”的方法是什么?