Decodable and JSON, 2 datatypes for same variable
I'm using the Decodable protocol to decode some json, but I've run into a problem: I'm getting an answer back, where a longitude and a latitide can be either an interger (latitude = 0) if there's no geo location data added to the element, and a String (fx. latitude = "25.047880") if there's geodata available. Now when I decode the json, I don't know how to build my Struct, as the long and lat can't both be String and Int.. So I'm getting a decode error when fetching elements where both cases are represented. Any suggestions about how to solve this? I've tried with "Any" as datatype, but this