We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
null
pipe-expression
A sub-expression is very similar to a pipe-expression with a few key differences:
sub-expression
However, in some cases, those differences can be ignored.
For instance, currently JMESPath.NET works like this:
search( `null`.[@], {} ) -> null
search( `null` | [@], {} ) -> [ null ]
Given those expressions do not involve any projection, they should have the same result. This calls into question which is the correct result.
Compliance tests suggests the correct result is null and not [ null ]. The canonical JavaScript implementation agrees with this.
[ null ]
However, the specification calls out how a sub-expression (and thus, by extension) a pipe-expression should be implemented.
left-evaluation = search(left-expression, original-json-document) result = search(right-expression, left-evaluation)
However, compliance tests cannot succeed by following this guideline. For instance, this compliance test looks like so:
search( foo.[a || b], {"type": "object"} ) -> null
Which evaluates to:
identifier
foo
multi-select-list
or-expression
a
b
Instead, the correct implementation seems to be:
left-evaluation = search(left-expression, original-json-document) if (left-evaluation == null) result = null else result = search(right-expression, left-evaluation)
The text was updated successfully, but these errors were encountered:
jdevillard#76 - Fixed incorrect null propagation on the rhs of a `p…
354955a
…ipe-expression`.
#76 - Fixed incorrect null propagation on the rhs of a `pipe-expres…
30f6e4e
…sion`. (#77)
Successfully merging a pull request may close this issue.
A
sub-expression
is very similar to apipe-expression
with a few key differences:sub-expression
restricts the kinds of expressions allowed on its right-hand-side.pipe-expression
stops a projection on the left-hand-side from propagating to the right-hand-side.However, in some cases, those differences can be ignored.
For instance, currently JMESPath.NET works like this:
search( `null`.[@], {} ) -> null
search( `null` | [@], {} ) -> [ null ]
Given those expressions do not involve any projection, they should have the same result.
This calls into question which is the correct result.
Compliance tests suggests the correct result is
null
and not[ null ]
.The canonical JavaScript implementation agrees with this.
However, the specification calls out how a
sub-expression
(and thus, by extension) apipe-expression
should be implemented.However, compliance tests cannot succeed by following this guideline.
For instance, this compliance test looks like so:
search( foo.[a || b], {"type": "object"} ) -> null
Which evaluates to:
identifier
foo
which cannot be found in the original json document. Thus returnsnull
.multi-select-list
against the valuenull
.or-expression
evaluates identifiersa
andb
which cannot be found in the current valuenull
. Thus it returnsnull
.null
value.Instead, the correct implementation seems to be:
The text was updated successfully, but these errors were encountered: