Skip to content

Square Brackets Indexing Strings in Parse #193

Open
@DarrinGlad

Description

@DarrinGlad

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions