ietf-wg-jsonpath / draft-ietf-jsonpath-base

Development of a JSONPath internet draft
https://ietf-wg-jsonpath.github.io/draft-ietf-jsonpath-base/
Other
60 stars 20 forks source link

Nodelists on RHS of in-op #122

Open cabo opened 3 years ago

cabo commented 3 years ago

(Spin-off from #120:)

Discuss: @.color in $..allowed_color We make sure that the paths on the LHS only yield a single node; the paths on the RHS may yield multiple nodes and the nodelist is examined like a JSON array would be. [How do we distinguish these cases?] ➔ disallow paths that can yield multiple nodes on the in-op RHS as well.

goessner commented 3 years ago

well ... treating a nodelist as an array, may lead after resolving to something like ...

'red' in [["red","green"],["red","blue"]]

Since lhs value is tested to be contained in the rhs array ... no deep search is done ... result is false.

cabo commented 3 years ago

I'd rather say that the nodelist is a nodelist, and an array is a (JSON) array. So "in" could have different semantics, e.g., by returning the disjunction of matching the values of the nodes.

gregsdennis commented 3 years ago

So "in" could have different semantics

In what scenarios would you want to treat a nodelist different than an array?

I tend to agree with the opening comment.

cabo commented 2 years ago

We decided not to have " in ", so this is now closed/revisit-after-base-done.