Swift 4 JSON Codable - value returned is sometimes an object, others an array
the data I'm getting from an API returns a single object but when there's multiple objects, it returns an array in the same key. With the current model (struct) I'm working with, the decoding fails when an array shows up. These results are randomly ordered, meaning I can't know when I will be served an object or array. Is there a way to create a model that takes this fact into account and can assign the correct type to cast for the value ('String' or '[String]') so that the decoding continues without problem? This is an example of when an object is returned: { "firstFloor": { "room": "Single