-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] invalid jsonpath when key has "@" in its name #4213
Comments
Hi! Thanks for reporting. Ultimately the problem here is with JSONPath being a sorta ill-defined spec itself. Check out https://cburgmer.github.io/json-path-comparison/ for a taste of how much variation there is. I dug into this and there's some good news: TLDR, use
I created https://mockbin.org/bin/cdc1f76d-b720-4a91-abbc-f0410f2f4222/view for the sake of testing this. It returns: {
"hydra:member": [
{
"@id": "0123-4567-8888",
"type": "Avenger"
},
{
"@id": "0123-4567-8910"
}
],
"@test": true
} It's not anything to do with This query works just fine:
But when you introduce the Despite having test coverage for this (in I can confirm this is a regression, but I'm going to raise this to the rest of the team to know more about changes in the future. I doubt we're going to be switching back to Here's an example of it working with the latest release: Adding to the above, I'd also like to note that, at least (as an upside) the behavior on jsonpath.com seems to more closely map to what |
Great ! Thanks for your reply, the escape solution with The integration of |
Expected Behavior
jsonpath should resolve correctly
Actual Behavior
Using the response of a previous request to set an environment variable errors out when the json property has a
:
in its nameReproduction Steps
Use this json (response from another request):
use
$['hydra:member'][0]['@id']
as the jsonpath expression, live preview shows:Invalid JSONPath query: $['hydra:member'][0]['@id']
Is there an existing issue for this?
Additional Information
This solution worked great before and was broken with recent updates
Insomnia Version
2021.6.0-1
What operating system are you using?
Other Linux
Operating System Version
Linux 5.10.70-1-MANJARO #1 SMP PREEMPT Thu Sep 30 15:29:01 UTC 2021 x86_64 GNU/Linux
Installation method
AUR package
Last Known Working Insomnia version
2021.5.3
The text was updated successfully, but these errors were encountered: