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

Function to get JSON type #479

Open gregsdennis opened 11 months ago

gregsdennis commented 11 months ago

This StackOverflow question needs the ability to isolate values of a given type. I think this would make a good function.

$.foo[?type(@)=='object']

The function would return a string (one of object, array, number, string, boolean, null) that indicates the value type of the parameter, which is a ValueType.

Not sure if true and false should be combined into boolean or not. Technically, these are merely tokens, not actual "boolean" values, though the association is strong.

cabo commented 11 months ago

Definitely useful. I believe the majority of users of JSONPath would perceive true and false to be part of a common type boolean, so I would design this function extensions to the principle of least surprise.

This issue is now listed in #480.

gregsdennis commented 11 months ago

I don't think linking this issue in a list warrants closing it. This still remains unresolved.

cabo commented 11 months ago

Like all other issues marked revisit-after-base-done. We had this discussion.

gregsdennis commented 5 months ago

Related to #172