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

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

Improve well typedness rules #418

Closed gregsdennis closed 1 year ago

gregsdennis commented 1 year ago

Builds on #412. Attempts to address this comment from @cabo:

There are 16 combinations. 5 of them are explained. You need functions like exist() and value() to make a few more work.

Only valid/well-formed scenarios are explained; others are considered invalid/poorly-formed.

gregsdennis commented 1 year ago

The PR needs to generalise the rules which apply to existence tests and comparisons.

I don't follow. How does the current text not do this?

This will necessarily reintroduce certain conversions...

I'm not sure it does. We've been careful to explicitly declare the behavior of everything where it's valid/well-formed. (Personally I think the conversions are clearer, but that's not what this PR is about.)

glyn commented 1 year ago

Argh! I dismissed my review but this ended up approving the PR rather than changing it to a comment. (The github docs claim is would change to a comment.) @cabo & @goessner: please note.

gregsdennis commented 1 year ago

I'd also like to revisit the text quoted in https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/pull/418#discussion_r1127034954 to add the empty nodelist -> Nothing case that is notably missing. A separate PR, though, and maybe only if this goes through.