What you will do
You will run the prepared expression in the playground above, change one input at a time, and explain the result. Start in CEL only, then repeat the same rule in CEL + JSON.
How it works
A CEL string represents Unicode text. A bytes value represents raw bytes and is a different type; it is not a second spelling of text. Concatenation with + accepts strings on both sides. Characters such as Ľ and 👋 remain part of the string without special application logic.
Read the prepared example
The CEL + JSON rule is:
greeting + ', ' + name + ' 👋'Its input is:
{
"greeting": "Hello",
"name": "Ľubica"
}The CEL only tab contains the values and the rule in one expression. The enabled cel.bind() extension keeps each name local to its final argument.
Evaluation step by step
greetingsupplies the first text fragment.- Two more string fragments and
nameare joined from left to right. - The result is one Unicode string.
Your task
- Run both modes.
- Replace the name with text containing your own diacritics.
- In CEL only, run
type(bytes('CEL')) == bytes.
Expected observation: The greeting preserves Unicode characters; the type check for bytes() returns true.
Common mistake
Do not use bytes merely because text will eventually be stored or transmitted. Use it only when the host API expects a byte sequence.
Show the explanation
No. They are different types and require an explicit, supported conversion.
Knowledge check
Can a bytes value be concatenated directly with a string?
Key takeaway
Use string for human-readable text. Treat bytes as a separate data type with a separate purpose.
Sources
CEL-DEV— official CEL overview.CEL-LANG— official CEL language definition.CEL-GO-BIND— official documentation for the optionalcel.bind()extension used by the self-contained tab.