Xcode 12.2, App and simulator crashing during parsing JSON file into array



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”
So if anyone could help, I would appreciate it!
Harri



You should better show your Rest.json and the code for parsing it.

Generally, when you get The given data was not valid JSON., the input data (which you think is JSON) is not valid JSON and you need to correct it.
Xcode 12.2, App and simulator crashing during parsing JSON file into array
 
 
Q