If you use a quot (single or double) in a JSONPath in an environment then the json path won't be escaped properly.
For example the JSONPath $.data[?(@.formName=="EOS-Abnahme Protokoll" && @.versionId==69)],
it will translate to
"submitionId": "{% response 'body', 'req_525189fc59f842748426b27683438059', '$.data[?(@.formName=="EOS-Abnahme Protokoll" && @.versionId==69)].submissionId' %}"
Notice the " in the filter. As a workaround, you can change in the preference to the Nunjuck Power User Modus and escape the quots manually, but this requires a restart and it is much more comfortable with the ui (for me at least).

I hope this helps.
๐ Thanks for opening your first issue! If you're reporting a ๐ bug, please make sure
you include steps to reproduce it. If you're requesting a feature ๐, please provide real
use cases that would benefit. ๐ช
To help make this a smooth process, please be sure you have first read the
contributing guidelines.
Ah yes, I think this has been reported before. It's a tricky one to fix properly since the tag editor has no concept of the language that it's being used inside of. Different escaping strategies would be needed for every content-type (JSON, XML, etc).
One workaround for now is to use single quotes instead. These will automatically be escaped at the Nunjucks tag level, ending up with something like this:
"{% response 'body', 'req_525189fc59f842748426b27683438059', '$.data[?(@.formName==\'EOS-Abnahme Protokoll\' && @.versionId==69)].submissionId' %}"
Hmm, nvm. Apparently escaped single quotes are not valid JSON either ๐ฆ
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi, I faced the same issue: can't use single quotes in JSONPath, like $.data['my-test']
Is there a workaround?
The only workaround I found (haven't checked since I write the issue) is to switch to the Nunjuck Power User Modus in the settings (a restart is required) and escape it manually and then switch back again.
Hi, I faced the same issue: can't use single quotes in JSONPath, like $.data['my-test']
Is there a workaround?
@gschier gave me this workaround, that worked:
{
"filter": "$['@something']",
"testing": "{% response 'body', 'req_abc', filter, 'never' %}"
}
Also, the fix included in https://github.com/getinsomnia/insomnia/commit/8adee60c8671291712b8ad33f6bbc1e43c453c16 will be released soon!
Most helpful comment
Also, the fix included in https://github.com/getinsomnia/insomnia/commit/8adee60c8671291712b8ad33f6bbc1e43c453c16 will be released soon!