For deserialising a json object, I had to define a parent class that would contain an object or an array of objects for the child class. It has to be an object if an object
I've been using the Json.NET Nuget package, and it's been really easy to work with:
string jsonStr = "{'y':{'x':[{'data':28}, {'data':56}, {'data':89}]}}";
dynamic jobject = JsonConvert.DeserializeObject(jsonStr);
bool isArray = jobject.y.x.Type == JTokenType.Array;
bool isObject = jobject.y.x.Type == JTokenType.Object;
Hope this helps!