You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My understanding based on the specification is that the content of a literal expression, i.e. the text between backticks, is supposed to be a valid JSON expression, otherwise it should be reported as a syntax error. The Python implementation seems to be treating them as strings instead, though. For example, this is accepted as a valid JMESPath expression:
thing == `wat`
even though I would think it should cause an error. Is this an actual bug in the Python implementation, or have I been misunderstanding the spec? (In the latter case I'd argue that the spec is misleading about this to the point of it being a documentation bug, but that's a separate issue.)
Here's a short script that demonstrates the error:
I would expect to see the jmespath part of the output be the same as the json part of the output, i.e. some kind of parsing error. And if I try other kinds of values, I do indeed get consistent results. For example, replacing the literal_json assignment line with literal_json = '3' gives
$ python test-jmespath.py json: no parse errorresult: 3jmespath: no parse errorresult: False
and if I replace it with literal_json = '{"foo": bar}' I get
My understanding based on the specification is that the content of a literal expression, i.e. the text between backticks, is supposed to be a valid JSON expression, otherwise it should be reported as a syntax error. The Python implementation seems to be treating them as strings instead, though. For example, this is accepted as a valid JMESPath expression:
even though I would think it should cause an error. Is this an actual bug in the Python implementation, or have I been misunderstanding the spec? (In the latter case I'd argue that the spec is misleading about this to the point of it being a documentation bug, but that's a separate issue.)
Here's a short script that demonstrates the error:
It prints out the following:
I would expect to see the
jmespath
part of the output be the same as thejson
part of the output, i.e. some kind of parsing error. And if I try other kinds of values, I do indeed get consistent results. For example, replacing theliteral_json
assignment line withliteral_json = '3'
givesand if I replace it with
literal_json = '{"foo": bar}'
I getThe text was updated successfully, but these errors were encountered: