{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri"
    },
    "version": {
      "type": "number",
      "const": 1
    },
    "rules": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/__schema0"
              },
              "path": {
                "$ref": "#/$defs/__schema1"
              },
              "level": {
                "$ref": "#/$defs/__schema2"
              },
              "title": {
                "$ref": "#/$defs/__schema3"
              },
              "message": {
                "$ref": "#/$defs/__schema4"
              },
              "operator": {
                "type": "string",
                "enum": [
                  "hasChildren",
                  "hasDescendants",
                  "hasPath"
                ]
              },
              "value": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema5"
                }
              }
            },
            "required": [
              "id",
              "path",
              "operator",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/__schema0"
              },
              "path": {
                "$ref": "#/$defs/__schema1"
              },
              "level": {
                "$ref": "#/$defs/__schema2"
              },
              "title": {
                "$ref": "#/$defs/__schema3"
              },
              "message": {
                "$ref": "#/$defs/__schema4"
              },
              "operator": {
                "type": "string",
                "const": "matchesTree"
              },
              "value": {
                "type": "object",
                "properties": {
                  "name": {
                    "$ref": "#/$defs/__schema6"
                  },
                  "children": {
                    "$ref": "#/$defs/__schema7"
                  }
                },
                "additionalProperties": false,
                "description": "Exact, unordered children at each specified level. Omitted children leave descendants unchecked; an empty array requires a leaf. At most 128 node levels, counting the selected root as level 1."
              }
            },
            "required": [
              "id",
              "path",
              "operator",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/__schema0"
              },
              "path": {
                "$ref": "#/$defs/__schema1"
              },
              "level": {
                "$ref": "#/$defs/__schema2"
              },
              "title": {
                "$ref": "#/$defs/__schema3"
              },
              "message": {
                "$ref": "#/$defs/__schema4"
              },
              "operator": {
                "type": "string",
                "const": "exists"
              },
              "value": {
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "path",
              "operator",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/__schema0"
              },
              "path": {
                "$ref": "#/$defs/__schema1"
              },
              "level": {
                "$ref": "#/$defs/__schema2"
              },
              "title": {
                "$ref": "#/$defs/__schema3"
              },
              "message": {
                "$ref": "#/$defs/__schema4"
              },
              "operator": {
                "type": "string",
                "const": "count"
              },
              "value": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "id",
              "path",
              "operator",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/__schema0"
              },
              "path": {
                "$ref": "#/$defs/__schema1"
              },
              "level": {
                "$ref": "#/$defs/__schema2"
              },
              "title": {
                "$ref": "#/$defs/__schema3"
              },
              "message": {
                "$ref": "#/$defs/__schema4"
              },
              "operator": {
                "type": "string",
                "enum": [
                  "includesAll",
                  "includesAny"
                ]
              },
              "value": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema9"
                }
              }
            },
            "required": [
              "id",
              "path",
              "operator",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/__schema0"
              },
              "path": {
                "$ref": "#/$defs/__schema1"
              },
              "level": {
                "$ref": "#/$defs/__schema2"
              },
              "title": {
                "$ref": "#/$defs/__schema3"
              },
              "message": {
                "$ref": "#/$defs/__schema4"
              },
              "operator": {
                "type": "string",
                "const": "unique"
              }
            },
            "required": [
              "id",
              "path",
              "operator"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/__schema0"
              },
              "path": {
                "$ref": "#/$defs/__schema1"
              },
              "level": {
                "$ref": "#/$defs/__schema2"
              },
              "title": {
                "$ref": "#/$defs/__schema3"
              },
              "message": {
                "$ref": "#/$defs/__schema4"
              },
              "operator": {
                "type": "string",
                "enum": [
                  "equals",
                  "notEquals"
                ]
              },
              "value": {}
            },
            "required": [
              "id",
              "path",
              "operator",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/__schema0"
              },
              "path": {
                "$ref": "#/$defs/__schema1"
              },
              "level": {
                "$ref": "#/$defs/__schema2"
              },
              "title": {
                "$ref": "#/$defs/__schema3"
              },
              "message": {
                "$ref": "#/$defs/__schema4"
              },
              "operator": {
                "type": "string",
                "const": "matches"
              },
              "value": {
                "type": "string",
                "maxLength": 256,
                "description": "A linear-time RE2-compatible regular expression."
              },
              "flags": {
                "description": "Linear-time regular expression flags: case-insensitive (i), multiline (m), dot-all (s), and Unicode (u).",
                "$ref": "#/$defs/__schema10"
              }
            },
            "required": [
              "id",
              "path",
              "operator",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/__schema0"
              },
              "path": {
                "$ref": "#/$defs/__schema1"
              },
              "level": {
                "$ref": "#/$defs/__schema2"
              },
              "title": {
                "$ref": "#/$defs/__schema3"
              },
              "message": {
                "$ref": "#/$defs/__schema4"
              },
              "operator": {
                "type": "string",
                "enum": [
                  "lessThan",
                  "lessThanOrEqual",
                  "greaterThan",
                  "greaterThanOrEqual"
                ]
              },
              "value": {
                "type": "number"
              }
            },
            "required": [
              "id",
              "path",
              "operator",
              "value"
            ],
            "additionalProperties": false
          }
        ]
      }
    }
  },
  "required": [
    "version",
    "rules"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "__schema1": {
      "type": "string",
      "minLength": 1,
      "pattern": "^\\$.*",
      "description": "RFC 9535 JSONPath expression."
    },
    "__schema2": {
      "default": "error",
      "type": "string",
      "enum": [
        "error",
        "warning"
      ]
    },
    "__schema3": {
      "type": "string"
    },
    "__schema4": {
      "type": "string"
    },
    "__schema5": {
      "type": "string",
      "minLength": 1
    },
    "__schema6": {
      "$ref": "#/$defs/__schema5"
    },
    "__schema7": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema8"
      }
    },
    "__schema8": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema5"
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema8"
          }
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "__schema9": {},
    "__schema10": {
      "type": "string",
      "maxLength": 4,
      "pattern": "^[imsu]*$"
    }
  },
  "$id": "https://gltf.joyco.studio/validation-schema.json",
  "title": "glTF custom validation schema"
}
