Closed vanillamasonry closed 3 years ago
You should remove the second period (after "error"). So the correct expression is $.error['.tag']
instead of $.error.['.tag']
.
I am using the (unofficial) specification from https://goessner.net/articles/JsonPath/.
It says that a child operator is either a period followed by a name (as in .error
) or a name in square brackets (as in ['.tag']
).
In your example you use both at the same time. The jsonpath.com site seems to accept this, but my parser follows the rules more strictly.
Hope this helps.
Thanks again, https://jsonpath.com/ misled me.
Hi,
How can I escape "." in the front/ end of an element?
I have the following JSON: { "error_summary": "expired_access_token/", "error": { ".tag": "expired_access_token" } }
I need to select ".tag" using JPath using https://jsonpath.com/ I select the element with $.error.['.tag'] Using Neslib.Json I have the following error "Child operator in JSON path is missing a member name"
Thank you in advance,