Skip to content

Square Brackets Indexing Strings in Parse #193

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

Open
DarrinGlad opened this issue Apr 17, 2025 · 0 comments
Open

Square Brackets Indexing Strings in Parse #193

DarrinGlad opened this issue Apr 17, 2025 · 0 comments

Comments

@DarrinGlad
Copy link

JSONPATH Square brackets indicate the handling of JSON arrays.

Currently, brackets are indexing strings. For example, the following doesn't return the expected output None but ‘e’. This is incorrect in JSONPATH

import json
from jsonpath_ng.ext import parse

json_data = {‘test_key’: ‘test_value’}

jsonpath_expression = parse('$.test_key[0]')[0].value
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

No branches or pull requests

1 participant