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

Step 1 to a fix for #436 (editorial work remains) #438

Closed cabo closed 1 year ago

cabo commented 1 year ago

-| $[?bar(1==1)] | not well-typed, where bar is a function with a parameter of type LogicalType and result type LogicalType, as 1==1 is neither a query nor a function expression with a suitable result type +| $[?bar(@.*)] | well-typed, where bar is a function with a parameter of type LogicalType and result type LogicalType | +| $[?bar(1==1)] | well-typed, where bar is a function with a parameter of type LogicalType and result type LogicalType | +| $[?bar(1)] | not well-typed, where bar is a function with a parameter of type LogicalType and result type LogicalType, as 1 is not a query, logical-expr, or function expression |

Any parameter type works with $[?bar(@.*)]

glyn commented 1 year ago

-| $[?bar(1==1)] | not well-typed, where bar is a function with a parameter of type LogicalType and result type LogicalType, as 1==1 is neither a query nor a function expression with a suitable result type +| $[?bar(@.*)] | well-typed, where bar is a function with a parameter of type LogicalType and result type LogicalType | +| $[?bar(1==1)] | well-typed, where bar is a function with a parameter of type LogicalType and result type LogicalType | +| $[?bar(1)] | not well-typed, where bar is a function with a parameter of type LogicalType and result type LogicalType, as 1 is not a query, logical-expr, or function expression |

Any parameter type works with $[?bar(@.*)]

Indeed. We could make the example more general by not talking about the parameter type there.

cabo commented 1 year ago

Indeed. We could make the example more general by not talking about the parameter type there

Or by adding a bit variety. Done.

gregsdennis commented 1 year ago

Any parameter type works with $[?bar(@.*)]

How does this work with a ValueType parameter?

cabo commented 1 year ago

Any parameter type works with $[?bar(@.*)]

How does this work with a ValueType parameter?

It doesn't. Example needs to be fixed. Thanks.