Assert
Assert (assert)
Validate an event against a JSON Schema, based on IETF’s draft v7 (http://json-schema.org).
Validation json
Minimal example
actions: - assert: behaviour: no-warnings: drop-onfailure schema: schema-file: ""JSON
{ "actions": [ { "assert": { "behaviour": { "no-warnings": "drop-onfailure" }, "schema": { "schema-file": "" } } } ]}Contents
Fields
| Field | Type | Required | Description |
|---|---|---|---|
description | string | describe this step. | |
condition | lua-expression (string) | Only run this action if the specified condition is met. Examples: 2 * count() | |
schema | Schema | ✅ | The JSON schema to validate an event against. Allowed values: schema-file, schema-string |
behaviour | Behaviour | ✅ | What the job should do if it encounters a schema violation. Allowed values: no-warnings, drop-onfailure, abort-on-failure |
suppress-warnings ✓ | boolean (bool) | Suppress warnings generated by this action. Default: false |
Schema
Schema Options
| Option | Name | Type | Description |
|---|---|---|---|
schema-file | Schema File | string | File containing JSON schema. Examples: /path/to/file, c:\users\joe\data\file.txt |
schema-string | Schema String | string | JSON schema as text. |
Behaviour Options
| Option | Name | Type | Description |
|---|---|---|---|
no-warnings | No Warnings | symbol | Switch off warnings. Allowed values: drop-onfailure, abort-on-failure |
drop-onfailure | Drop Onfailure | bool | Just Drop the Event. Default: false |
abort-on-failure | Abort On Failure | bool | Abort the job. Default: false |
Behaviour - No Warnings Options
| Value | Name | Description |
|---|---|---|
drop-onfailure | drop-onfailure | Drop Onfailure |
abort-on-failure | abort-on-failure | Abort On Failure |