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

JSON file and parsing code in this folder

I guess you made a spelling mistake in one of the json fields… Or your not using multiple levels

Maybe swiftjson can help… Check our article about it https://codewithchris.com/swiftyjson/

@Dangerous_Duos
Harri,

This is a duplicate post. An answer has been supplied to your previous post so I will close this one.