Closed shames0 closed 1 year ago
I think it’s expected as you can see the preventEval
option is false
by default in README - JSONPath.
preventEval (default: false) - Although JavaScript evaluation expressions are allowed by default, for security reasons (if one is operating on untrusted user input, for example), one may wish to set this option to true to throw exceptions when these expressions are attempted.
If I set preventEval
to true
in development and run the query string again, I will get an error Eval [?(expr)] prevented in JSONPath expression.
.
So the question is, should I change “Query with JSONPath“ to something like “Process with JSONPath“.
I intend to keep it unchanged because I will also be introducing “Process with jq“ in the next release. So these two things need to be a little more different.
Describe the bug If you query a JSON structure using the "Query with JSONPath" feature of OK JSON, and use a single
=
rather than a double==
to test equivalence, an assignment occurs behind the scenes and subsequent queries in the same window become inaccurate.To Reproduce Given the JSON list:
If you "Query with JSONPath" starting from the root node with the following query, the result is expectedly
undefined
:But if you first run this query (without knowing what your'e doing), an assignment takes place and the structure being queried is modified:
You can confirm that something was modified when you run the first query again in the same window and find that it surprisingly yields results:
RESULTS
Expected behavior The queried structure should not be mutated by a query expression
Screenshots
Additional context Using OK JSON Version 2.4 (111)