{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/Jamonygr/az400-azure-devops-engineer-labs/blob/main/curriculum/question-schema.json",
  "title": "AZ-400 original scenario question bank",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "labId", "verifiedDate", "sources", "questions"],
  "properties": {
    "schemaVersion": {"const": 2},
    "labId": {"type": "string", "pattern": "^(0[1-9]|1[0-9]|2[0-5])$"},
    "verifiedDate": {"const": "2026-10-16"},
    "sources": {
      "type": "array", "minItems": 1,
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["id", "url"],
        "properties": {"id": {"type": "string", "pattern": "^S[1-9][0-9]*$"}, "url": {"type": "string", "format": "uri", "pattern": "^https://"}}
      }
    },
    "questions": {
      "type": "array", "minItems": 50, "maxItems": 50,
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["id", "checkpointId", "objectiveIds", "difficulty", "question", "options", "correctAnswers", "explanation", "sourceIds"],
        "properties": {
          "id": {"type": "string", "pattern": "^L(0[1-9]|1[0-9]|2[0-5])-Q0(0[1-9]|[1-4][0-9]|50)$"},
          "checkpointId": {"enum": ["CP1", "CP2", "CP3", "CP4", "CP5"]},
          "caseId": {"type": "string", "pattern": "^L[0-9]{2}-C[0-9]{2,}$"},
          "task": {"type": "string", "minLength": 3},
          "caseContext": {"type": "string", "minLength": 40},
          "exhibit": {
            "type": "object", "additionalProperties": false, "required": ["language", "code"],
            "properties": {"language": {"type": "string", "pattern": "^[a-zA-Z0-9_+#-]+$"}, "code": {"type": "string", "minLength": 10}}
          },
          "objectiveIds": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^D[1-5]\\.[1-6]\\.[1-9]$"}},
          "difficulty": {"enum": ["foundational", "applied", "advanced"]},
          "question": {"type": "string", "minLength": 40},
          "options": {
            "type": "array", "minItems": 4, "maxItems": 4,
            "items": {
              "type": "object", "additionalProperties": false,
              "required": ["key", "text", "rationale"],
              "properties": {"key": {"enum": ["A", "B", "C", "D"]}, "text": {"type": "string", "minLength": 1}, "rationale": {"type": "string", "minLength": 24}}
            }
          },
          "correctAnswers": {"type": "array", "minItems": 1, "maxItems": 1, "items": {"enum": ["A", "B", "C", "D"]}},
          "explanation": {"type": "string", "minLength": 40},
          "sourceIds": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^S[1-9][0-9]*$"}}
        }
      }
    }
  }
}
