Hi I have a problem with this Json:
{
"id": "libMovies",
"jsonrpc": "2.0",
"result": {
"limits": {
"end": 75,
"start": 0,
"total": 1228
},
"movies": [{
"art": {
"fanart": "myfanart",
"poster": "myposter"
},
"file": "myfile",
"label": "mylable",
"movieid": mymovieid,
"playcount": 0,
"rating": myrating,
"thumbnail": "mythumbnail"
}]
}
}
When I parse Json in swift 5 with this code
try! JSONDecoder().decode([MyMovie].self, from: data!)
I get this error
Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.typeMismatch(Swift.Array, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array but found a dictionary instead.", underlyingError: nil)):
How can I solve this?