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
Problem: It's not possible to provide type-hints for with-hyphen and $startsWithDolalrSign
CEL can get type information well if we can express an object as protobuf, or use StructType. However, there are times when we have objects that have non-identifier keys.
Right now, it's not possible to provide typesafety for non-identifier keys.
It would be amazing if we could.
Alternatives considered
To solve this for ourselves, we considered to hacks:
Use aliases: walk the CEL tree, and rename all non-identifer keys to some known identifer-style key.
Run our own compile step validation: walk the cel tree, and do the type checking ourselves.
Right now we are going with 2., but if there was some built-in way to specify types for keys from index access, it would be amazing.
Consider a JSON object
{ "with-hyphen": "a-string", "$startsWithDollarSign": 123 }Problem: It's not possible to provide type-hints for
with-hyphenand$startsWithDolalrSignCEL can get type information well if we can express an object as protobuf, or use
StructType. However, there are times when we have objects that have non-identifier keys.Right now, it's not possible to provide typesafety for non-identifier keys.
It would be amazing if we could.
Alternatives considered
To solve this for ourselves, we considered to hacks:
Right now we are going with 2., but if there was some built-in way to specify types for keys from index access, it would be amazing.