Validate Json
To ensure that data has a particular structure, this action can be used to validate a Json structure against a Json Schema (opens in a new tab).
Validate Json
Name: general/validateJson@v1
Description: Validate a Json structure against a Json Schema. The workflow execution will fail if the data does not match with the schema.
Version: v1
Input
The attributes key takes the following input:
Parameter | Type | Description | Required |
---|---|---|---|
schema | object | The Json Schema. | ✅ |
data | Json structure | The structure to validate the Json Schema against. | ✅ |
Output
Parameter | Type | Description | Required |
---|---|---|---|
data | Json structure | The validated Json structure. | ✅ |
Usage
YAML
- id: validateJson
name: general/validateJson@v1
attributes:
schema:
type: object
properties:
name:
type: string
age:
type: number
required:
- name
- age
additionalProperties: false
data:
name: 'Jan'
age: 18