I just downloaded a huge JSON file with all current MTG sets/cards, and am looking to deserialize it all.
I've gotten most of each set deserialized, but I'm running into a snag when trying to deserialize the booster object within each Set:
As you can see from the above two pictures, in each booster object there is a list of strings, but for some booster objects there is also an additional array of more strings. Deserializing an array of exclusively strings isn't a problem. My issue arises when I run into those instances where there is an array of strings within the booster object that need deserializing.
Currently the property I have set up to handle this deserialization is:
public IEnumerable<string> booster { get; set; }
But when I run into those cases where there's another array within booster I get an exception thrown, where Newtonsoft.Json complains it doesn't know how to handle the deserialization.
So, my question then becomes: how can I go about deserializing an array of strings contained within an array of strings? And what would an object need to look like in C# code to handle that sort of deserialization?


Newtonsoft.Json, it tries to map each object to a property name inside C# code. My only idea thus far is to create aBoosterobject for it to map to, but then I'm not sure how to include an "optional"IEnumerable<string>part for those cases where there does exist another array within theboosterobject.StringConverterfrom this one seems even more relevant: How to handle json that returns both a string and a string array?. Then declare yourboosterproperty as follows:[JsonProperty(ItemConverterType = typeof(StringConverter))] public List<List<string>> booster { get; set; }