Change:
Exclude the node itself Define the term "descendants" more precisely Define the descendant selector semantics more thoroughly Fixes: URL
I would consider adding two additional examples: given: results in: - and results in: - ] ]
I extended the existing example attempting to exhibit the same points as the example above.
Looks good, thanks!
Considering the following input: would evaluate to (in this case the values of the object): I would expect the descendant version: to evaluate to: Yet the example says: Considering the following pseudo logic: In the case of the would be an index wildcard selector. I would expect the descendant selector to (starting by selecting itself) walk through the json structure and select all the results by applying the child selector (dot-member-name, index-selector, index-wild-selector, or wildcard) on each traversed value. Am I misunderstanding something here or is this the intended behavior?
Thanks for raising this. When I was writing the example, I noticed that only a few implementations included the node itself. But the descendant selector semantics currently say: and so I included the "starting" node itself. This is why I included the following text in the commit message: The semantics section needs improving anyway to clarify the semantics of the various forms of the descendants selector. I agree with the semantics proposed above, providing there is a consensus for this in the WG.
In my understanding descendant selector simply extends the single-level operating of child selector , in that it further recursively operates on all other descendant levels. So I agree to Bram's traversal algorithm above. A node is not considered a descendant of itself. Obviously I have not been aware of this behavior.
I haven't checked the examples, but I like the narrative changes.

Discussion:
JSONPath allows the wildcard symbol "*" to select any member of an object or any element of an array (wildcard).  The descendant <del> operator ".." selects the node and all its descendants (descendant- selector).  The array slice syntax "[start:end:step]" allows selecting a regular selection of an element from an array, giving a start position, an end position, and possibly a step value that moves the position from the start to the end (slice). </del> <ins> operator ".." selects all the descendants (descendant-selector) of a node.  The array slice syntax "[start:end:step]" allows selecting a regular selection of an element from an array, giving a start position, an end position, and possibly a step value that moves the position from the start to the end (slice). </ins> Filter expressions are supported via the syntax "?(<boolean expr>)" as in

Array slice selector "[<start>:<end>:<step>]", where the optional values "<start>", "<end>", and "<step>" are integer literals. <del> Nested descendants selector "..". </del> <ins> Descendants selector "..". </ins> List selector "[<sel1>,<sel2>,...,<selN>]", holding a comma separated list of index and slice selectors.

3.5.7.2. <del> The "descendant-selector" selects the node and all its descendants. </del> <ins> The "descendant-selector" selects certain descendants of a node: </ins> <del> In the resultant nodelist: * nodes occur before their children, and * nodes of an array occur in array order. </del> <ins> the "..<name>" form (and the "..[<index>]" form where "<index>" is a "quoted-member-name") selects those descendants of the node that are member values of an object with the given member name. the "..[<index>]" where "<index>" is an "element-index" selects those descendants of the node that are array elements with the given index. the "..[*]" and "..*" forms select all the descendants of the node. In the resultant nodelist: nodes occur before their children, and nodes of an array occur in array order. </ins> Children of an object may occur in any order, since JSON objects are unordered.

Queries: <del> Note: This ordering of the results for the "$..[*]" and "$..*" </del> <ins> Note: The ordering of the results for the "$..[*]" and "$..*" </ins> examples above is not guaranteed, except that: <del> "{"o": {"j": 1, "k": 2}, "a": [5, 3]}" must appear before "{"j": 1, "k": 2}" and "[5, 3]", </del> "{"j": 1, "k": 2}" must appear before "1" and "2", <del> "[5, 3]" must appear before "5" and "3", and </del> <ins> "[5, 3, [{"j": 4}]]" must appear before "5", "3", and "[{"j": 4}]", "5" must appear before "3" which must appear before "[{"j": 4}]", "[{"j": 4}]" must appear before "{"j": 4}", and </ins> <del> "5" must appear before "3". </del> <ins> "{"j": 4}" must appear before "4". </ins> 3.5.8.