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

"exists()" function? #448

Closed f3ath closed 1 year ago

f3ath commented 1 year ago

There is the value() function to convert NodesType to a value to avoid implicit type conversions. Should there also be a similar LogicalType exists(Nodes nodes) function? An alternative name could be exist() or isNotEmpty().

gregsdennis commented 1 year ago

There's already an implicit conversion from NodesType to LogicalType that does this.

https://www.ietf.org/archive/id/draft-ietf-jsonpath-base-11.html#name-type-conversion

The function isn't necessary.

f3ath commented 1 year ago

Ah, I missed the following note in 2.4.8:

Note: a singular query may be used anywhere where a ValueType is expected, so there is no need to use the "value" function extension with a singular query.

Now I see that my question does not make sense.