Closed wmalloc closed 1 year ago
Hey! How're you decoding this? Normally I'd expect a different error message if you're decoding ListAllMyBucketsResult
. I'm missing the path to the Name
key specifically, which should include the parent Buckets
let decoder = XMLDecoder()
decoder.shouldProcessNamespaces = true
decoder.dateDecodingStrategy = .formatted(self.dateFormatter)
return try decoder.decode(ListAllMyBucketsResult.self, from: response.data)
I played around some more so I was able to decode but had to add extra object
struct ListAllMyBucketsResult {
let buckets: Buckets
}
struct Buckets {
let bucket: [Bucket]
}
struct Bucket {
let name
let creationDate
}
Ah right, I also overlooked that. Good thing you spotted it :)
I am trying to decode this response
My structure looks like this.
I am getting this error:
debugDescription : "No attribute or element found for key CodingKeys(stringValue: \"Name\", intValue: nil) (\"Name\")."
Thanks for helping,sorry if this is not allowed here.