I'm having this json:
{
"paths": {
"foo": {
"key": 1
},
"bar": {
"key": 2
}
}
}
I would like to use JSONPath to find element "foo" by its name ("foo")
I tried something like $.paths.*.[?(~=='foo')] but it does not seem to work (I checked on https://jsonpath.com)