Slide 21
Slide 21 text
let json = """
{
"id" : 1234,
"name" : "maguhiro",
"age" : 34
}
""".data(using: .utf8)!
let user = try! JSONDecoder()
.decode(User.self, from: json)
//
Swift.DecodingError.typeMismatch(Swift.Dictionary,
Swift.DecodingError.Context(codingPath:
[CodingKeys(stringValue: "id", intValue: nil)],
debugDescription: "Expected to decode
Dictionary but found a number
instead.", underlyingError: nil))