I'm using JsonFX (it's a requirement, Json.Net isn't an option) to pull values out of Json, but I don't want to have to create a class to deserialize to for every bit of Json that I want to parse. So if I have this bit of JSON:
{
Parent:
{
Name: "John",
Child:
{
Name: "Bob",
Age: 20
}
}
}
I'd like to randomly access Child.Name. With Json.Net, I'd just do JObject.Parse(json)["Parent"]["Child"]["Name"]. I need to do the same, using JsonFX.
Using the debugger, I can see that this:
Object results = JsonFx.Json.JsonReader.Deserialize(response);
Pretty much gets me there. If I look at results, it's essentially a dictionary, with all of the data in a format that I would expect. The problem is, because it's an Object, I can't access any of those values. results["Parent"] doesn't compile.
How can I get at these values, without creating a class that mirrors the data?
JsonFX is awesome. Just read it into a dynamic and access the data.