Replies: 2 comments 1 reply
-
@TristonianJones apologies for bugging you here directly, are you using discussions in this project or is it better to move this into an issue? |
Beta Was this translation helpful? Give feedback.
-
@mrueg not a problem, thanks for moving this to a discussion. Simply put, CEL is not jsonpath. The conveniences of jsonpath are well-suited to JSON, but not necessarily something we want to support in CEL; however, you could expose a jsonpath function which would allow you to blend the two together. The expression you provided, the JSON literal, is a valid CEL literal. To express something equivalent in CEL, you'd probably do the following: |
Beta Was this translation helpful? Give feedback.
-
I've asked here and thought it might be good to ask here as well.
Does anyone have a minimal example how to parse and execute CEL against top-level JSON arrays?
with jsonpath I could query a key like the following:
{ [*].predator }
What is the CEL equivalent to do that?
Here's the eval function that is used in cel-playground where I came across the problem: https://github.com/undistro/cel-playground/blob/main/eval/eval.go#L51
Beta Was this translation helpful? Give feedback.
All reactions