function

Evaluates a Common Expression Language (CEL) expression and emits the result. The expression may reference named sub-schemas specified in the variables property.

Inputs

expressionrequired

The CEL expression.

variablesoptional

An object of named schema definitions that may be referenced in expression.

Examples

{
  "type": "function",
  "expression": "username + '@' + domain",
  "variables": {
    "username": {
      "type": "string",
      "pattern": ".{2,64}"
    },
    "domain": {
      "type": "select",
      "options": [
        {
          "weight": 5,
          "schema": {
            "type": "constant",
            "value": "example.com"
          }
        },
        {
          "weight": 2,
          "schema": {
            "type": "constant",
            "value": "example.org"
          }
        }
      ]
    }
  }
}