So basically what I want is for anytime that the API returns a type different than what the model expects to make that property nil.
For example:
struct Person {
var name: String?
var someType: String?
}
If the API returns a number for the someType property instead of a string I want to just make its value nil
I know I can do that implementing the init(from decoder: Decoder)
initializer but then I'd have to set that up for every property of every response which would take a long time. Is there a better and quicker way?