My JSON is this:
{
…
"episodes": {
"1": [
{
"id": 533072,
"season": 1,
"episode": 1,
"nombre": "La hija del general",
"firstaired": "2012-12-06",
"const": 8
},
{
"id": 533078,
"season": 1,
"episode": 2,
"nombre": "Caballo de Troya",
"firstaired": "2012-12-06",
"const": 8
},
{
"id": 533073,
"season": 1,
"episode": 3,
"nombre": "Cosecha",
"firstaired": "2012-12-06",
"const": 8
},
…
}
My question is, how do I create the JSON structure in Swift 4? I tried this:
struct detailInfo: Decodable{
let seasons: [seasons]?
let episodes: episodes
}
struct seasons: Decodable{
let id: Int
let season: Int
}
struct episodes: Decodable{
???
}
I do not know how to continue the JSON from here ...
Thanks !!