Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dash should not be treated as a valid character in unquoted identifiers #80

Closed
oliverrahner opened this issue Feb 10, 2022 · 1 comment

Comments

@oliverrahner
Copy link

oliverrahner commented Feb 10, 2022

According to the spec (and jmespath/jmespath.rb#12),

- is not valid in unquoted identifiers as it is used for negative numbers

But the simulator on the jmespath front page does not complain.

I wasn't familiar with jmespath and tried to build a valid expression, then carried it to the application I wanted to use it with and wondered for some hours why it didn't do what I wanted.

Example:

Expression:
contains(resource_access.monitoring-application.roles[*], 'admin') && 'I am ze admin!'

Document:

{
  "resource_access": {
    "monitoring-application": {
       "roles": [
          "admin"
       ]
    }
  }
}

The above should not be valid, but returns "I am ze admin!".
The go implementation errors out with "SyntaxError: Invalid token: tNumber"

@oliverrahner
Copy link
Author

Just saw that this is already addressed in #67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant