{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.7/checks/suite.schema.json",
  "$comment": "OpenEik 0.7: folded by tools/fold-schemas-0.7.mjs from the proposal checks, which 0.7 makes a rule (open questions, 169). Written by hand, not generated.",
  "title": "A suite's manifest, suite.json",
  "description": "A suite of checks (Part XXIII, 2): its name and version, its layer, the suites of lower layers it pins, and the values it gives the parameters of their checks and its own.",
  "type": "object",
  "required": [
    "format",
    "name",
    "version",
    "layer",
    "says"
  ],
  "additionalProperties": false,
  "properties": {
    "format": {
      "const": "openeik-suite/0.1"
    },
    "name": {
      "description": "The suite's name (rule 1).",
      "$ref": "#/$defs/name"
    },
    "version": {
      "description": "Its version, MAJOR.MINOR.PATCH (rule 1).",
      "$ref": "#/$defs/version"
    },
    "layer": {
      "description": "Its layer (rule 2): base, jurisdiction, organisation or project.",
      "enum": [
        "base",
        "jurisdiction",
        "organisation",
        "project"
      ]
    },
    "says": {
      "description": "What the suite is, in a sentence.",
      "type": "string",
      "minLength": 1,
      "maxLength": 1000
    },
    "country": {
      "description": "A jurisdiction's pack's country, an ISO 3166-1 alpha-2 code, by which a runner picks it for a building whose site is in that country (rule 2; Part II, 2.2, rule 6). A suite of another layer gives none.",
      "type": "string",
      "pattern": "^[A-Z]{2}$"
    },
    "extends": {
      "description": "The suites of lower layers it runs on top of, each pinned to one version (rule 3).",
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "object",
        "required": [
          "name",
          "version"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "$ref": "#/$defs/name"
          },
          "version": {
            "$ref": "#/$defs/version"
          }
        }
      }
    },
    "requires": {
      "description": "A project suite's: the suites, itself among them where it names its own name, whose failures at the severity error block a merge of the building (rule 6).",
      "type": "array",
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/name"
      }
    },
    "params": {
      "description": "The values it gives the parameters of checks, its own and those of the suites below it, by the check's qualified id <suite>/<check> and the parameter's name (rule 4); a value read from a file of its folder's params/ where it is {file}.",
      "type": "object",
      "maxProperties": 200,
      "propertyNames": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*/[a-z][a-z0-9]*(-[a-z0-9]+)*$",
        "maxLength": 129
      },
      "additionalProperties": {
        "type": "object",
        "maxProperties": 20,
        "propertyNames": {
          "type": "string",
          "pattern": "^[a-z][A-Za-z0-9]*$",
          "maxLength": 40
        },
        "additionalProperties": {
          "oneOf": [
            {
              "not": {
                "type": "object"
              }
            },
            {
              "type": "object",
              "not": {
                "required": [
                  "file"
                ]
              }
            },
            {
              "type": "object",
              "required": [
                "file"
              ],
              "additionalProperties": false,
              "properties": {
                "file": {
                  "type": "string",
                  "pattern": "^params/[a-z0-9][a-z0-9-]*\\.json$",
                  "maxLength": 120
                }
              }
            }
          ]
        }
      }
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "layer": {
            "const": "base"
          }
        },
        "required": [
          "layer"
        ]
      },
      "then": {
        "properties": {
          "extends": {
            "maxItems": 0
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "layer": {
            "const": "jurisdiction"
          }
        },
        "required": [
          "layer"
        ]
      },
      "then": {
        "required": [
          "country"
        ]
      },
      "else": {
        "not": {
          "required": [
            "country"
          ]
        }
      }
    },
    {
      "if": {
        "properties": {
          "layer": {
            "not": {
              "const": "project"
            }
          }
        },
        "required": [
          "layer"
        ]
      },
      "then": {
        "not": {
          "required": [
            "requires"
          ]
        }
      }
    }
  ],
  "$defs": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
    },
    "version": {
      "type": "string",
      "maxLength": 40,
      "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
    }
  }
}
