You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you put = instead of == or === in filter expression [?(@.<property>=<value>], it actually replaces in the result all values of that <property> with new <value>.
Yes, this is a result of the fact that eval is used to evaluate filters. Closing, as this is effectively a dupe of #60 .
But please note that this library is no longer under active development. But if someone supplies a well-documented PR, we may be able to review, so you could watch #60 in case that occurs.
Describe the bug
If you put
=
instead of==
or===
in filter expression[?(@.<property>=<value>]
, it actually replaces in the result all values of that<property>
with new<value>
.Code sample or steps to reproduce
Json path
Result:
Console error or logs
Tried this on https://jsonpath-plus.github.io/JSONPath/demo/ site, there were no errors in logs.
Expected behavior
I would prefer this handled as invalid syntax.
Expected result
hmm, it could be empty, idk
Environment (IMPORTANT)
Tried this on https://jsonpath-plus.github.io/JSONPath/demo/, sorry, can't find the version it uses.
Desktop**
Additional context
Actually, this caught me in https://github.com/Kong/insomnia, but found this behavior in the library itself.
According to http://jsonpath.com/, original implementation has this issue too.
PS
Sorry, I am not a JS developer, cannot provide all details and didn't manage to track the root of the problem further.
The text was updated successfully, but these errors were encountered: