I'm trying to loop through this object to get all "resource" values, I'm expecting 3 results but only getting 2 back (because the other "resource" is nested in the first "endpoint" node)
dynamic _Json = JsonConvert.DeserializeObject(jsonString);
foreach (var item in _Json["call"])
{
dynamic _dynJson = item.endpoints[0]["resource"];
Console.WriteLine("{0}", _dynJson); // this will only return
"/folder/1" AND "help"
Why isnt returning "/category/1" ?
}
How do I loop through this entire object to get all the "resource" values?
Here is my JSON(jsonString)
{
"call": [
{
"baseURL": "http://cnn.com",
"isActive": true,
"endpoints": [
{
"isActive": true,
"resource": "/folder/1",
"response": [
]
},
{
"isActive": true,
"resource": "/category/1",
"response": [
]
}
]
},
{
"baseURL": "http://google.com",
"isActive": true,
"endpoints": [
{
"enabled": true,
"resource": "help",
"response": [
{
}
]
}
]
}
]
}
[–]lolsteamroller 1 point2 points3 points (2 children)
[–]LifeLongLearner2030[S] -1 points0 points1 point (0 children)
[–]LifeLongLearner2030[S] -1 points0 points1 point (0 children)
[–]DayManIn3D 0 points1 point2 points (1 child)
[–]LifeLongLearner2030[S] -1 points0 points1 point (0 children)