It seems to be very simple, but I just can't figure out how to do it. I use an external api to get JSON results (using Newtonsoft.JSON), problem is a poor design which leaves me with a array with mixed types like this:
{"data":["Monday 13 january", {"id":"1234aa","name":"teamA"},{"id":"1234bb","name":"teamB"}, "Tuesday 14 january", {"id":"1234aa","name":"teamA"}]}
This will result in an object like:
public class RootObject
{
public List<object> data { get; set; }
}
I want to ignore those date strings and deserialize the objects into a typed array
public class RootObject
{
public List<Team> data { get; set; }
}
Any idea's how to achieve this kind of behavior?
Update: Maybe I wasn't clear about it, but I'm not looking for a solution which does soms transformation after the deserialization. I want some integrated solution, eg with a JsonConverter.