I started working with Decodable some days ago, and I want to know if is it possible to create the model "Car" without create any more model, having this JSON:
{
"cars": [
{
"id": 1,
"name": "car1"
},
{
"id": 2,
"name": "car2"
},
{
"id": 3,
"name": "car3"
}
],
"pagination": {
"page": 1,
"offset": 20
}
}
The only solution that I found is to create a "wrappwer" model like "Response", containing a property as [Cars].
Can somebody confirm me that is possible to decode this JSON just having the "Car" model?
Thank you.
Best regards