asl-validator
Version:
Amazon States Language validator
102 lines (101 loc) • 3.07 kB
JSON
{
"$id": "http://asl-validator.cloud/jsonata.json#",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"output": {
"oneOf": [
{
"$ref": "#/definitions/jsonata"
},
{
"$ref": "#/definitions/_jsonata_template_object"
}
]
},
"assign": {
"$ref": "#/definitions/_jsonata_template_object"
},
"arguments": {
"oneOf": [
{
"$ref": "#/definitions/jsonata"
},
{
"$ref": "#/definitions/_jsonata_template_object"
}
]
},
"queryLanguage": {
"type": "string",
"enum": ["JSONata"]
},
"condition": {
"$ref": "#/definitions/jsonata"
},
"jsonata": {
"$comment": "A string that is a JSONata expression",
"type": "string",
"pattern": "^\\{% .+ %\\}$",
"format": "jsonata_string"
},
"not_jsonata": {
"$comment": "A string that is not a JSONata expression",
"type": "string",
"pattern": "^(?!\\{% )(.+)(?! %\\})$"
},
"maybe_jsonata": {
"oneOf": [
{
"$ref": "#/definitions/not_jsonata"
},
{
"$ref": "#/definitions/jsonata"
}
]
},
"_jsonata_template_object": {
"type": "object",
"patternProperties": {
"^.+$": {
"$comment": "Require string fields to be maybe_jsonata",
"oneOf": [
{
"type": ["number", "boolean", "null"]
},
{
"$ref": "#/definitions/maybe_jsonata"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/jsonata_template"
}
},
{
"$ref": "#/definitions/_jsonata_template_object"
}
]
}
}
},
"jsonata_template": {
"oneOf": [
{
"$ref": "#/definitions/_jsonata_template_object"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/_jsonata_template_object"
}
},
{
"type": ["boolean", "number", "null"]
},
{
"$ref": "#/definitions/maybe_jsonata"
}
]
}
}
}