Reputation: 941
I'm consuming a JSON feed that returns a structure with an array of irregular objects - I can't predict what's in the array, and whatever is there will change over time. A simple example is
{
"content":
[
{
"person" : "john"
},
{
"car" : "Audi"
}
]
}
The JsonPath query
$.content.[0]
returns the first object in that array. But, I need a jsonpath query that returns the literal NAME of the first property of that object, in this case I need the query to return "person". Is this possible?
Upvotes: 14
Views: 2705