value.customerId.matches("[0-9]{8}")
.
==
and >
as well as macros like has()
to check for the presence of fields. See the CEL language definition for details.EnforceAvro
ensures that:
avro
.Email RegEx validation
value.customer.email.matches(r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$")
UUID RegEx validation
value.customer.id.matches(r"^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$")
Ensure Header is JSON
headers['Content-Type'] == 'application/json'
orders-*
Manage data quality
permission enabled.
To apply this permission to a group, go to Settings > Groups and in the Resource access tab tick the Manage data quality
checkbox for the relevant resources, as required.
What does Policy status mean?
How do I handle headers with dashes?
headers['Content-Type']
Why can't `type()` figure out the right numeric types?
number
— there’s no distinction between int
and double
. As a result, expressions like type(value.age) == int
may fail unexpectedly, even if:value.age > 0 && value.age < 130
This implicitly checks that the field is numeric and falls within a valid range, avoiding type inference.Note: CEL currently can’t evaluate against Avro schemas directly — it only sees the JSON-converted payload.We recommend enabling Gateway debug logs to inspect how data is interpreted during rule evaluation and to understand why it may have failed.