However, when running my project, I get the following error when I try and view this data.
Thread 5: Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [_JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "events", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "location", intValue: nil)], debugDescription: "Expected to decode Array<Any> but found a dictionary instead.", underlyingError: nil))
If I comment out the var location:[String] = [] part within the struct the project works fine without any issues. So I'm assuming there's some kind of formatting issue I'm having it?
This is how to read the error you are getting to know exact location of the problem (it's the last line in the codingPath, along with the key path leading to it):