einride / aip-go

Go SDK for implementing resource-oriented gRPC APIs.
https://aip.dev
MIT License
165 stars 18 forks source link

filtering with a property including a hyphen errs with unexpected trailing token - #317

Open lopezator opened 3 days ago

lopezator commented 3 days ago

Hello!

I am using this filter that is a valid gcp pubsub filter to work with cloudevents (it's working on prod), however, when trying to parse it using pstest (that uses this library to parse the filtering expression) I am unable to parse it.

The filter expression is the following:

attributes.ce-service=user OR attributes.ce-service=accessright

And the error:

^ unexpected trailing token - (1:14)

I tried to quote the expression to try to fix the things out, but that didn't help either.

Input:

"attributes.ce-service=user OR attributes.ce-service=accessright"

Err:

non-bool result type

I guess that is taking that "-" as an operator, but didn't found a way to do it (backslash didn't work).

I had to disable the filtering locally as before this was implemented:

https://github.com/googleapis/google-cloud-go/pull/9015

Thank you!