Skip to content

Fix CEL bindings for maps for this variable #278

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

Merged
merged 4 commits into from
May 1, 2025
Merged

Conversation

smaye81
Copy link
Member

@smaye81 smaye81 commented May 1, 2025

This fixes the variable binding to this for maps. Previously, the binding was using a map of the custom value abstraction ObjectValue that we use in protovalidate-java. This Value class has no relation at all to CEL-Java's Val object. So, using it as a variable binding does not work because CEL-Java doesn't know how to interpret it.

This adds an additional mapValueAsObject function to return a map of Objects for the binding. Note this not ideal, but should be sufficient for now. Further context in the comments.

@smaye81 smaye81 requested review from pkwarren and jchadwick-buf May 1, 2025 14:47
@smaye81 smaye81 merged commit ffe0dd3 into main May 1, 2025
5 checks passed
@smaye81 smaye81 deleted the sayers/map_bindings branch May 1, 2025 18:19
@smaye81 smaye81 changed the title Fix CEL bindings for maps Fix CEL bindings for maps for this variable May 1, 2025
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

Successfully merging this pull request may close these issues.

2 participants