**CEL (Common Expression Language)** lets you write dynamic response logic that is evaluated at request time rather than saved as a static body. With CEL you can:
CEL (Common Expression Language) lets you write dynamic response logic that is evaluated at request time rather than saved as a static body. With CEL you can:
Return different responses based on path parameters, query parameters, or headers
Generate random UUIDs or timestamps in every response
Simulate conditional logic (e.g., return 404 for unknown IDs)
CEL is sandboxed and Turing-incomplete, making it safe to execute on the server.
[!IMPORTANT]
Your expression must return a map with single-quoted string keys. Unquoted identifiers are treated as variable references and will fail if the variable is not defined.
{ 'status': <int>, // required — HTTP status code 'body': <any>, // optional — response body 'headers': <map<string, string>> // optional — extra response headers}
[!WARNING]
Path parameters are always strings. Compare with string literals, not integers:
request.path_params.id == "42" // correctrequest.path_params.id == 42 // wrong — type mismatch, will always be false
[!NOTE]
CEL variants bypass response-body schema validation at save time. Validation only applies to static variants. The body returned by a CEL expression is not checked against the OpenAPI schema.