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

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

Include input value in descendant selector #252

Closed glyn closed 1 year ago

glyn commented 2 years ago

The current draft applies descendant selectors to the (strict) descendants of the input value. However, as mentioned in https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/issues/201#issuecomment-1225065352, it would better reflect current implementations if descendant selectors applied to the input value as well as its descendants.

The comparison project has a test for this which shows a consensus among existing implementations.

glyn commented 2 years ago

See https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/issues/201#issuecomment-1228825045

glyn commented 2 years ago

@cabo I think it would still be legitimate to call the descendant selectors by that name since the values they select are all descendants of the input value. (The one exception would be if we were to allow .. on its own, in which case the input value would be in the resultant nodelist.)

glyn commented 1 year ago

At the 2022-9-27 interim meeting there was a consensus for implementing this issue.