jmespath / jmespath/jmespath.test

Filters not working intuitively

Open
#15 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
7
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Maybe it is my misunderstanding, but with this data:

```
{
"a": {
"b": [{
"c": {
"d": {
"e": "foo"
}
},
"something": "bar"
}, {
"c": {
"d": {
"e": "miss"
}
}
}]
}
}
```

With the following query, nothing returns:

`a.b[*].c.d[?e == 'foo']`

But this does work:

`a.b[*].c.d|@[?e == 'foo']`

And in JSON Path (JayWay implementation for example):

`a.b[*].c.d[?(@.e == "foo")]` is the equivalent.

Is this intentional? they seem functionally equivalent but obviously are not. This fails in the playground (JavaScript), but also fails in the Java implementation.

Is this a spec issue? As designed? Common bug in all implementations? Where do we report something like this that seems to be prevalent across all of JMES?

Contributor guide

No contributing guide indexed for this repository

Research direction

The payload names no files or tests. Reproduce the two queries in the JavaScript playground and Java implementation, then compare their behavior with the cited JayWay JSONPath result; done requires an explicit decision about whether the filter semantics are intentional and how compliance should represent them.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript, python
Domain
testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.