Kong / Kong/insomnia

Filtering all the keys not working

Open
#3,258 5 comments 0 reactions 0 assignees View on GitHub
B-bug needs-triage S-unverified
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

**Describe the bug**
I'm trying to filter out all the keys from the JSON response of WordPress API. When going to https://jsonpath.com/ and trying

```bash
$.routes.*~
```

I get the keys of all routes. When I type this in the Insomnia I get an empty array.

**To Reproduce**
JSON example

```json
{
"name": "WordPress",
"description": "Just another WordPress site",
"url": "https:\/\/mysite.test",
"home": "https:\/\/mysite.test",
"gmt_offset": "0",
"timezone_string": "",
"namespaces": [
"oembed\/1.0",
"menus\/v1",
"acf\/v3",
"wc-bookings\/v1",
"wc\/store",
"wc-analytics",
"wc-admin",
"wc\/v1",
"wc\/v2",
"wc\/v3",
"wccom-site\/v1",
"wp\/v2",
"wp-site-health\/v1"
],
"authentication": {
"application-passwords": {
"endpoints": {
"authorization": "https:\/\/mysite.test\/wp-admin\/authorize-application.php"
}
}
},
"routes": {
"\/": {...},
"/batch/v1": {...},
"/oembed/1.0": {...},
"/oembed/1.0/embed": {...},
"/oembed/1.0/proxy": {...}
}
}
```

**Expected behavior**
I expect to see something like

```json
[
"/",
"/batch/v1",
"/oembed/1.0",
"/oembed/1.0/embed",
"/oembed/1.0/proxy"
]
```

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: macOS 11.2.3 Big Sur
- Installation Method: https://insomnia.rest/download
- Version: Insomnia 2021.1.1
- Release date: 10/03/2021
- OS: Darwin x64 20.3.0
- Electron: 9.1.1
- Node: 12.14.1
- V8: 8.3.110.13-electron.0
- Architecture: x64
- node-libcurl: libcurl/7.69.1 OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.7 libidn2/2.1.1 libssh2/1.9.0 nghttp2/1.41.0

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the $.routes.*~ expression in Insomnia with the WordPress JSON example and compare its result with jsonpath.com. The issue is done when filtering all keys returns the listed route names instead of an empty array.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.