JSON_SCHEMA_VALIDATE

Returns a validation error message if the object provided does not match the provided json schema, using the https://json-schema.org/ syntax or an empty string otherwise.

Syntax 

JSON_SCHEMA_VALIDATE(object, any)

Usage examples 

Example 1

Input

1
{
2
"schema": {
3
"type": "object",
4
"properties": {
5
"abc": {
6
"type": "integer",
7
"minimum": 11
8
}
9
}
10
},
11
"my_action": {
12
"value1": {
13
"abc": 10
14
}
15
}
16
}

Formula

JSON_SCHEMA_VALIDATE(schema, my_action.value1)

Output

1
{
2
"value1": "Number at `/abc` is less than: 11"
3
}
Was this helpful?