This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Foo { | |
let json: [Any] | |
} | |
extension Foo: Decodable { | |
enum Keys: String, CodingKey { | |
case json | |
} | |
init(from decoder: Decoder) throws { | |
let cont = try decoder.container(keyedBy: Keys.self) | |
json = try cont.decode(Array<Any>.self, forKey: .json) |