Hi all. I have an error as Xcode isn’t letting me parse my JSON file data into an array. It says in the diagnostic report that “Fatal error: Couldn’t parse Rest.json as Array:
dataCorrupted(Swift.DecodingError.Context(codingPath: , debugDescription: “The given data was not valid JSON.”, underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 “No string key for value in object around character 3.” UserInfo={NSDebugDescription=No string key for value in object around character 3.}))): file SaiMirrasKitchen/ModelData.swift, line 30”
Your JSON file is invalid. There is a missing comma in the record with the id of 1014
"id":1014,
"name":"Egg Kurma"
"imageName":"eggkurma",
"description":"Slit eggs boiled and mixed with gravy. Made up of spices and coconut. Great for both rice and chapathi.",
"category":"Curries"
should be:
"id":1014,
"name":"Egg Kurma",
"imageName":"eggkurma",
"description":"Slit eggs boiled and mixed with gravy. Made up of spices and coconut. Great for both rice and chapathi.",
"category":"Curries"