Skip to content

Searching for literal * keys return all when * unavailable #77

@micimize

Description

@micimize

Searching for a literal * with $['*'] yields the following unexpected behavior:

JSONPath({json: {'*': 'star', 'rest': 'rest', 'foo': 'bar'}, path: "$['*']"})
//=> [ 'star' ]
JSONPath({json: {'rest': 'rest', 'foo': 'bar'}, path: "$['*']"})
//=> [ 'rest', 'bar' ]

It's possible to work around this with $[?(@property === '*')], but this isn't usable in more complex queries, such as $[?(@property === '*'), rest]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions