draft-ietf-jsonpath-base icon indicating copy to clipboard operation
draft-ietf-jsonpath-base copied to clipboard

Nodelists on RHS of in-op

Open cabo opened this issue 4 years ago • 4 comments

(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.

cabo avatar Sep 17 '21 10:09 cabo

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.

goessner avatar Nov 10 '21 09:11 goessner

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.

cabo avatar Nov 10 '21 11:11 cabo

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.

gregsdennis avatar Nov 11 '21 05:11 gregsdennis

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

cabo avatar Jan 17 '22 22:01 cabo