Aug 8, 2017 · 1 min read
Make your page structs like so:
struct Page: Codable { let pageid: String let title: String let extract: String let thumbnail: [Thumbnail]}struct Thumbnail: Codable { let original: String}
All you need to do is first manually decode the returned JSON data to an array of ‘page’ JSON Data objects. Then you can use JSONDecoder to decode each JSON Data object to Page.self
