Background: I'm using swift [email protected] and I need to parse json data
AF.request("https://xxx.json").validate().responseDecodable(of: Decodable)
The data looks like:
[
[
"a",
123,
1.0,
],
[
"b",
456,
2.0,
],
]
My code (this is the wrong way):
struct Item: Codable {
var name: String
}
...responseDecodable(of: [Item].self)
Should I use enum instead? I read some similar answers but they all have keys at some point, my data is pure array without keys.