Skip to content
New issue

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

Function to get JSON type #479

Open
gregsdennis opened this issue Jul 9, 2023 · 4 comments
Open

Function to get JSON type #479

gregsdennis opened this issue Jul 9, 2023 · 4 comments

Comments

@gregsdennis
Copy link
Collaborator

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
Copy link
Member

cabo commented Jul 9, 2023

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
Copy link
Collaborator Author

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

@gregsdennis gregsdennis reopened this Jul 9, 2023
@cabo
Copy link
Member

cabo commented Jul 9, 2023

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

@cabo cabo closed this as completed Jul 9, 2023
@glyn glyn reopened this Dec 20, 2023
@glyn glyn reopened this Dec 20, 2023
@gregsdennis
Copy link
Collaborator Author

Related to #172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants