{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/problem-package-submissions/latest.json",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/RagnarGrootKoerkamp/BAPCtools/refs/heads/main/bapctools/resources/support/schemas/submissions_yaml_schema.json",
    "sourceSha256": "322044e80e7b31ee45409e06c2feadfaa8ca6141a52aa51ba3f4d4b8ea68f5e9",
    "fileMatch": [
      "submissions.yml",
      "submissions.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "additionalProperties": {
    "type": "object",
    "$ref": "#/$defs/submission",
    "additionalProperties": {
      "$ref": "#/$defs/expectation"
    }
  },
  "$defs": {
    "Person": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "kattis": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "orcid": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ]
        }
      ]
    },
    "Persons": {
      "anyOf": [
        {
          "$ref": "#/$defs/Person"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Person"
          },
          "prefixItems": [
            {
              "$ref": "#/$defs/Person"
            }
          ],
          "minLength": 1
        }
      ]
    },
    "expectation": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "permitted": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/verdict"
          },
          "prefixItems": [
            {
              "$ref": "#/$defs/verdict"
            }
          ],
          "minLength": 1
        },
        "required": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/verdict"
          },
          "prefixItems": [
            {
              "$ref": "#/$defs/verdict"
            }
          ],
          "minLength": 1
        },
        "score": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "array",
              "prefixItems": [
                {
                  "type": "integer"
                },
                {
                  "type": "integer"
                }
              ],
              "maxLength": 2,
              "minLength": 2
            }
          ]
        },
        "use_for_time_limit": {
          "enum": [
            false,
            "lower",
            "upper"
          ]
        }
      },
      "additionalProperties": false
    },
    "submission": {
      "type": "object",
      "$ref": "#/$defs/expectation",
      "properties": {
        "authors": {
          "$ref": "#/$defs/Persons"
        },
        "entrypoint": {
          "type": "string"
        },
        "language": {
          "type": "string"
        },
        "model_solution": {
          "type": "boolean"
        }
      },
      "additionalProperties": true
    },
    "verdict": {
      "enum": [
        "AC",
        "WA",
        "RTE",
        "TLE"
      ]
    }
  }
}
