Closed thefredelement closed 4 years ago
let Things: [ResponseThing]
would decode an array of Things
not an array of Thing
To decode the given XML you would need something like
struct Response: Codable {
let status: String
let Things: ThingContainer
}
struct ThingContainer: Codable {
let Thing: [ResponseThing]
}
struct ResponseThing: Codable {
let ID: String
}
You might also want to take a look at CodingKeys
, they will make your code much more readable.
As soon as I read that I got it, thank you!!!
Hi,
This is an awesome framework, thank you for making it. I have an XML that looks like this:
And a Codable that looks like this:
throws a missing key error... what am I missing?