Skip to content

Current object placeholder only works when its on the right side of an logical expression #180

@pranav-surya

Description

@pranav-surya

The following code works as expected

require 'jsonpath'

json = <<-JSON
{
"colors": [
"yellow",
"green"
]
}
JSON

path = JsonPath.new("$.colors[?(@ == 'green')]")
path.on(json)

but when we do this for the same json as in the above example, the filtering is not working as expected

path = JsonPath.new("$.colors[?('green' == @)]")
path.on(json)

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