I am trying to decode json data from an api in my swift app. However there is no key as the data returned is just an array. I have attached a screenshot of the response. How would I decode this data. enter image description here
Array decoding:
struct NameStruct: Codable {
let data: [DataBody]
}
struct DataBody: Codable {
let value: String
}
struct NameObject: Codable {
let item: [String]
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.