JSONPath array filter can't refer to root object ($)
- Dominant language
- TypeScript
- Stars
- 40k
- Forks
- 2.4k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 61
Description
The following JSONPath expression:
```$.included[?(@.id == $.data.relationships.target.id)]```
would be expected work with the following JSON, but does not: http://api.mocki.io/v1/9c54d246
Individually,
```$.included[?(@.id == "foo")]```
and
```$.data.relationships.target.id```
work, but not when combined.
**Desktop (please complete the following information):**
- OS: Big Sur
- Installation Method: download
- App Version: v2021.1.0
Contributor guide
Research direction
Start by reproducing the JSONPath expression against the linked JSON document, then trace the JSONPath evaluation entry point used by the client. Done means the combined filter can compare an array item with the root object's nested value, while the two individual expressions continue to work.
Written by the indexing model from the issue text.
Assessment
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100