-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This framework really works? keyNotFound #249
Comments
This should work, and is in our unit tests. Have you set |
Hello @Rufy86, In your code,
|
thank you very much for the answer but I've still problems Now I've no error from decoder but the objects are empty this is my code:
|
@Rufy86 are you expecting the whole hierarchy of XML inside that String? Because if so, that's not how XMLCoder was designed. Each XML element or attribute is decoded into it's own codable key/value. So you'll need to model your Codable type to match the expectations in XML. |
I'm try to decode an XML returned by an API. the result is an error:
Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.keyNotFound(CodingKeys(stringValue: "ns2:body", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "ns2:body", intValue: nil)], debugDescription: "No attribute or element found for key CodingKeys(stringValue: "ns2:body", intValue: nil) ("ns2:body").", underlyingError: nil))
this is the struct
`struct AirportList:Codable {
let ns2:String
}`
I've changed the key in model class, with any tag I need but the result is the same.
this framework really works?
The text was updated successfully, but these errors were encountered: