Skip to content

Filters are not implemented per spec #51

@SimplicityGuy

Description

@SimplicityGuy

jsonpath2 version

0.4.4

Platform Details

macOS Catalina, Python 3.8.4

Scenario:

In test case 10, you have:

expr = Path.parse_str('$..book[*][?(@.author = "Nigel Rees")]')

This seems correct. The behavior in jsonpath2 is correct though in http://jsonpath.com the behavior is different and is incorrect.

Another query that should result in the same results is:

expr = Path.parse_str('$..book[?(@.author = "Nigel Rees")]')

This should return a list of dict that filters only the author. In jsonpath2 this yields no results (and empty list). Yet on http://jsonpath.com, this works fine.

My understanding of the JsonPath spec is that this second query is valid and should result in what jsonpath2 is doing in test case #10. This understanding comes from the section on the JsonPath spec:

//book[price<10] $..book[?(@.price<10)] filter all books cheapier than 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions