Skip to content

condition for children does not work #38

@greyblake

Description

@greyblake

It was fixed for array here: #24

But still does not work, if a child is not an array:

json = <<-JSON
{
  "store": {
    "book": {
      "category": "reference",
      "author": "Nigel Rees",
      "title": "Sayings of the Century",
      "price": 8.95
    }
  }
}
JSON

pp JsonPath.new("$..book[?(@.price<10)]").on(json) # => []
# But expected to return the book

# But checking price directly works also
pp JsonPath.new("$..book.price[?(@<10)]").on(json) # => [8.95]

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