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

length not working when we run jsonpath query with SelectTokens #2688

Open
Kavin19 opened this issue May 30, 2022 · 1 comment · May be fixed by #2689
Open

length not working when we run jsonpath query with SelectTokens #2688

Kavin19 opened this issue May 30, 2022 · 1 comment · May be fixed by #2689

Comments

@Kavin19
Copy link

Kavin19 commented May 30, 2022

Sample JSON:

{
"firstName": "John",
"lastName": "doe",
"age": 26,
"address": {
"streetAddress": "naist street",
"city": "Nara",
"postalCode": "630-0192"
},
"phoneNumbers": [
{
"type": "iPhone",
"number": "0123-4567-8888"
},
{
"type": "home",
"number": "0123-4567-8910"
}
]
}

Query:
$.phoneNumbers.length

On using the 'SelectTokens' to run the query I am not able to get the length value from the query.

Expcted:
[
2
]

IMPORTANT NOTE:
https://github.com/json-path/JsonPath#functions

Can be Functions like length() supported here.

@elgonzo
Copy link

elgonzo commented May 30, 2022

FYI: duplicate of #1318

@Maksim-Trolina Maksim-Trolina linked a pull request Jun 4, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants