The specification for sub-expression outlines how it should behave in pseudocode:
left-evaluation = search(left-expression, original-json-document)
result = search(right-expression, left-evaluation)
However, this is incorrect, as many compliance tests expect the result to be null when the left-hand-side evaluates to null.
So, the real pseudocode shoud in fact be:
left-evaluation = search(left-expression, original-json-document)
if left-evaluation is `null` then result = `null`
else result = search(right-expression, left-evaluation)
Pipe Expression
However, it seems intuitive for pipe-expression to behave as is specified by the pseudocode above.
left-evaluation = search(left-expression, original-json-document)
result = search(right-expression, left-evaluation)
Which means that the evaluation should still happens if the left-hand-side is null.
Summary
This PR introduces a new compliance test that outlines the following expression: search ( `null` | [@], {} ) -> [ null ] in the hope to standardize the exact behaviour of pipe expressions.
Sub Expression
The specification for
sub-expression
outlines how it should behave in pseudocode:However, this is incorrect, as many compliance tests expect the result to be
null
when the left-hand-side evaluates tonull
. So, the real pseudocode shoud in fact be:Pipe Expression
However, it seems intuitive for
pipe-expression
to behave as is specified by the pseudocode above.Which means that the evaluation should still happens if the left-hand-side is
null
.Summary
This PR introduces a new compliance test that outlines the following expression:
search ( `null` | [@], {} ) -> [ null ]
in the hope to standardize the exact behaviour of pipe expressions.