Closed cabo closed 1 year ago
I don't think the example for $..[*]
in Table 17 is right.
https://www.ietf.org/archive/id/draft-ietf-jsonpath-base-10.html#section-2.7.2.3-3
It says:
[{"j"=>1, "k"=>2}, [5, 3, [{"j"=>4}, {"k"=>6}]], 1, 2, 5, 3, [{"j"=>4}, {"k"=>6}], {"j"=>4}, 4, {"k"=>6}, 6]
It should be:
[{"j"=>1, "k"=>2}, [5, 3, [{"j"=>4}, {"k"=>6}]], 1, 2, 5, 3, [{"j"=>4}, {"k"=>6}], {"j"=>4}, {"k"=>6}, 4, 6]
Note that the descendants list puts out [{"j"=>4}, {"k"=>6}]
before {"j"=>4}
and {"k"=>6}
.
The wildcard selector then has no choice but outputting {"j"=>4}
, {"k"=>6}
, 4
, 6
.
I don't think the example for
$..[*]
in Table 17 is right.https://www.ietf.org/archive/id/draft-ietf-jsonpath-base-10.html#section-2.7.2.3-3
It says:
[{"j"=>1, "k"=>2}, [5, 3, [{"j"=>4}, {"k"=>6}]], 1, 2, 5, 3, [{"j"=>4}, {"k"=>6}], {"j"=>4}, 4, {"k"=>6}, 6]
It should be:
[{"j"=>1, "k"=>2}, [5, 3, [{"j"=>4}, {"k"=>6}]], 1, 2, 5, 3, [{"j"=>4}, {"k"=>6}], {"j"=>4}, {"k"=>6}, 4, 6]
Note that the descendants list puts out
[{"j"=>4}, {"k"=>6}]
before{"j"=>4}
and{"k"=>6}
. The wildcard selector then has no choice but outputting{"j"=>4}
,{"k"=>6}
,4
,6
.
Nice catch! The example needs fixing as does the ordering note below Table 17.
I let the computer do the catching :-) Do you want to make these changes? I'd do a new issue then. (And wait a bit for Greg to catch up.)
@cabo Yes, I'm happy to do that and please do create a new issue. I won't be able to fix it before the weekend at the earliest though.
Add clarifications that the input nodelist provides the outer order, the segments provide a middle-level order, and selectors (if multiple) provide the inner order.
This may have been obvious to some readers, but now should be obvious to more, including yours truly.