{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/racecalendar-app/json-schema/racecalendar-app-season-schedule-payload-schema.json",
  "title": "SeasonSchedulePayload",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/racecalendar-app-openapi.yml#/components/schemas/SeasonSchedulePayload",
  "type": "object",
  "properties": {
    "year": {
      "type": "number"
    },
    "generatedAt": {
      "type": "string"
    },
    "lastVerifiedAt": {
      "type": "string"
    },
    "staleAfter": {
      "type": "string"
    },
    "refreshIntervalSeconds": {
      "type": "number"
    },
    "source": {
      "type": "string",
      "enum": [
        "OpenF1"
      ]
    },
    "weekends": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SeasonScheduleWeekend"
      }
    }
  },
  "required": [
    "year",
    "generatedAt",
    "lastVerifiedAt",
    "staleAfter",
    "refreshIntervalSeconds",
    "source",
    "weekends"
  ],
  "$defs": {
    "SeasonScheduleWeekend": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "round": {
          "type": "number"
        },
        "grandPrixName": {
          "type": "string"
        },
        "circuitName": {
          "type": "string"
        },
        "location": {
          "type": "string"
        },
        "countryName": {
          "type": "string"
        },
        "countryCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "gmtOffset": {
          "type": [
            "string",
            "null"
          ]
        },
        "startDate": {
          "type": "string"
        },
        "endDate": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "cancelled"
          ]
        },
        "statusNote": {
          "type": [
            "string",
            "null"
          ]
        },
        "resultStatus": {
          "type": "string",
          "enum": [
            "notStarted",
            "pending",
            "available"
          ]
        },
        "raceWinnerName": {
          "type": [
            "string",
            "null"
          ]
        },
        "raceWinnerConstructorName": {
          "type": [
            "string",
            "null"
          ]
        },
        "resultSummary": {
          "type": [
            "string",
            "null"
          ]
        },
        "sessions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SeasonSession"
          }
        }
      },
      "required": [
        "id",
        "round",
        "grandPrixName",
        "circuitName",
        "location",
        "countryName",
        "countryCode",
        "gmtOffset",
        "startDate",
        "endDate",
        "status",
        "statusNote",
        "resultStatus",
        "raceWinnerName",
        "raceWinnerConstructorName",
        "resultSummary",
        "sessions"
      ]
    },
    "SeasonSession": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "name": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/SessionKind"
        },
        "sessionType": {
          "type": "string"
        },
        "startDate": {
          "type": "string"
        },
        "endDate": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "displayName",
        "kind",
        "sessionType",
        "startDate",
        "endDate"
      ]
    },
    "SessionKind": {
      "type": "string",
      "enum": [
        "practice",
        "sprintQualifying",
        "sprint",
        "qualifying",
        "race",
        "other"
      ]
    }
  }
}