I have a third-party API response with one very unpredictable property, the rest are OK.
Sometimes the property is a full nested object, sometimes it's a blank string, sometimes it is an array... The docs are not very good.
Here are some sample responses, but there could be more variations:
"errors": {
"invalid_player_ids" : ["5fdc92b2-3b2a-11e5-ac13-8fdccfe4d986", "00cb73f8-5815-11e5-ba69-f75522da5528"]
}
"errors": ["Notification content must not be null for any languages."]
"errors": ""
Luckily this property is not too important, but a nice-to-have for logging purposes.
Is it possible to deserialize the model as usual but for this particular property errors, deserialize the whole thing into a string property? Like so?
public string Errors { get; set; }

public dynamic Error { get; set; }might do it