jp
jp copied to clipboard
jp not doing the same as the playground
input: {"z":{"a":{"b":"c"},"g":{"b":"d"},"h":{"b":"e"},"i":{"b":"f"}}} expression: z.*|[?b == `d`] on the playground returns: [ { "b": "d" } ] but on Debian 12.5 jp version 0.2.1 with: jp --filename z.json --expr-file z.jp returns: Error evaluating JMESPath expression: invalid character 'd' looking for beginning of value with return code 1.
Can confirm. I suspect this is related to handling of literals. The playground (and python implementation) interpret
`1`
as the number 1 and
`a`
as the string "a". jp does not seem to have the automatic string interpretation.
See
$ echo '[]' | jp '`a`'
Error evaluating JMESPath expression: invalid character 'a' looking for beginning of value
versus