I am struggling to write a JsonPath query to extract particular keys from the following sample Json.
{
"initial": "somevalue",
"somekey2": {
"inner1": "innerval1",
"inner2": "innerval2"
}
}
For example:
1) I wish to extract the first key, which in this case is initial
. Is this possible using JsonPath?
2) Get an inner key such as inner1
. Something similar to $."initial"."somekey2"
but returning an array with just the keys (inner1
and inner2
).