We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
let toml = """ [players] [players.'tom'] id = '33968bc5c8a95' health = 80 joinDate = 2019-03-10 17:40:00-07:00 [players.'steve'] id = '33968bc5c8a95' health = 80 joinDate = 2019-03-10 17:40:00-07:00 """ struct Team: Codable { struct Player: Codable { let id: String let health: Int let joinDate: Date } let players: [Player] } let team = try! TOMLDecoder().decode(Team.self, from: toml) print(team)
Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.valueNotFound(Swift.UnkeyedDecodingContainer, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "players", intValue: nil)], debugDescription: "Cannot get unkeyed decoding container -- found null value instead."
The text was updated successfully, but these errors were encountered:
ping @dduan
Sorry, something went wrong.
Hi, when you write in TOML
[players] [players.'tom'] id = '33968bc5c8a95'
it's equivalent to JSON
{ "players": { "tom": { "id": "33968bc5c8a95" }}
So that's a mismatch with your struct.
No branches or pull requests
The text was updated successfully, but these errors were encountered: