Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct JSON: Decodable {
- let block1: Format
- let block2: Format
- let block3: Format
- }
- struct Format: Decodable {
- let metadata: MetaData //[String: Any]
- let columns: [String] // columns names
- let data: [[Any]] // data of type in metadata
- }
- struct MetaData: Decodable {
- enum CodingKeys: String, CodingKey {
- case type, bytes
- case maxSize = "max_size"
- }
- let type: String
- let bytes: Int?
- let maxSize: Int?
- init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: CodingKeys.self)
- self.type = try container.decode(String.self, forKey: .type)
- self.bytes = try container.decode(Int.self, forKey: .bytes)
- self.maxSize = try container.decode(Int.self, forKey: .maxSize)
- }
- }
Add Comment
Please, Sign In to add comment