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

Descendant selector semantics #179

Closed glyn closed 2 years ago

glyn commented 2 years ago

Fixes: https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/issues/177

bram209 commented 2 years ago

I would consider adding two additional examples:

given:

{
  "j":  10,
  "o": {"j": 11, "k": 2},
  "a": [
     { "j": [3, 5] },
     { "j": [4, 6] }
  ]
}

$..[0] results in:

$..j and $..['j'] results in:

glyn commented 2 years ago

I would consider adding two additional examples:

given:

{
  "j":  10,
  "o": {"j": 11, "k": 2},
  "a": [
     { "j": [3, 5] },
     { "j": [4, 6] }
  ]
}

$..[0] results in:

* `{ "j": [3, 5] }`

* `3`

* `4`

$..j and $..['j'] results in:

* `10`

* `11`

* `[3, 5`]

* `[4, 6`]

I extended the existing example attempting to exhibit the same points as the example above.

bram209 commented 2 years ago

I extended the existing example attempting to exhibit the same points as the example above.

Looks good, thanks!