I cannot get this working in Newtonsoft JSON.net nor could I get this to work in any tester app I tried. I don't know why it's not working. Any variation I try fails. Can someone tell me what I'm doing wrong?
{
"Issue": {
"Id": 50170,
"NodeId": "MD=",
"Url": "https://api.github.com",
"HtmlUrl": "https://github.com",
"CommentsUrl": "https://api.github.com",
"EventsUrl": "https://api.github.com",
"Number": 105,
"State": {
"StringValue": "open",
"Value": 0
}
}
}
Json PATH
$.Issue.State[?(@.Value == 0)]
or
$.Issue[?(@.State.Value == 0)]
It always resolves to an empty set with no matches.
UPDATE
Per the comment below, thanks Michał Ziober, I tried a tester app that uses multiple implementations of Jsonpath. It seems that Jayway and Gatling implementations work, but the others do not. Newtonsoft JSON must be using one of the less capable parsers. :(