Cannot filter by digits-only string
aoyama-val opened this issue · 5 comments
aoyama-val commented
require "jsonpath"
json = <<'EOF'
{
"foo": {
"bar": "123",
"baz": "abc"
}
}
EOF
# OK
# should be: [{"bar"=>"123", "baz"=>"abc"}]
jsonpath = "$.foo[?(@.baz=='abc')]"
path = JsonPath.new(jsonpath)
p path.on(json)
# NG
# should be: [{"bar"=>"123", "baz"=>"abc"}]
# got: []
jsonpath = "$.foo[?(@.bar=='123')]"
path = JsonPath.new(jsonpath)
p path.on(json)
Skarlso commented
hi @aoyama-val. I'll look into it ASAP.
Skarlso commented
Thanks, nice spot!
Skarlso commented
Could you please re-test @aoyama-val? If it's still present, please re-open this ticket. :)
Thanks!
aoyama-val commented
I confirmed. Thank you for fixing!
Skarlso commented
Thanks! :) Np. 👍