-
Notifications
You must be signed in to change notification settings - Fork 90
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
supporting Hyphen"-" in Compile and Search #58
Comments
If this is like the python library what may work is edit: yep https://play.golang.org/p/8SezRZLbyMR |
For anyone else stumbling on this issue the following worked for me:
|
Is there an update on this? The workaround seems to work but doesn't seem ideal, especially for complex queries. |
Not being able to use field names with an - in a query is making problems quite often. Would be great to get it fixed. |
Didn't recognize the answer... Yes, with escaping using hyphen in keys works. |
Hi,
I tried the below code, where we want to search jmes path having Hyphen "-", I'm getting the following error
SyntaxError: Unexpected token at the end of the expression: tNumber
From the code it looks like the Hyphen "-" is considered as a reference to get numeric values.
go-jmespath/lexer.go
Lines 164 to 166 in 3d4fd11
Is it possible to pass values containing Hyphen "-"?
jmespath.Compile("foo-bar")
Please let us know if there is any other way to do that, If not please consider our suggestion.
Opinion:-
Can we add a filter func in Lexer
go-jmespath/lexer.go
Lines 23 to 29 in 3d4fd11
go-jmespath/lexer.go
Lines 388 to 392 in 3d4fd11
And we can call those filter func inside consuleUnquotedIdentifier
So I can support any key to be part of string and can override the existing feature.
The text was updated successfully, but these errors were encountered: