{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/racecalendar-app/json-schema/racecalendar-app-race-weekend-preview-payload-schema.json",
  "title": "RaceWeekendPreviewPayload",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/racecalendar-app-openapi.yml#/components/schemas/RaceWeekendPreviewPayload",
  "type": "object",
  "properties": {
    "year": {
      "type": "number"
    },
    "raceWeekend": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "round": {
          "type": "number"
        },
        "grandPrixName": {
          "type": "string"
        },
        "circuitName": {
          "type": "string"
        },
        "location": {
          "type": "string"
        },
        "countryName": {
          "type": "string"
        },
        "startDate": {
          "type": "string"
        },
        "endDate": {
          "type": "string"
        },
        "meetingOfficialName": {
          "type": [
            "string",
            "null"
          ]
        },
        "countryCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "circuitKey": {
          "type": [
            "number",
            "null"
          ]
        },
        "circuitType": {
          "type": [
            "string",
            "null"
          ]
        },
        "circuitImage": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "cancelled"
          ]
        },
        "statusNote": {
          "type": [
            "string",
            "null"
          ]
        },
        "sessions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SeasonSession"
          }
        }
      },
      "required": [
        "id",
        "round",
        "grandPrixName",
        "circuitName",
        "location",
        "countryName",
        "startDate",
        "endDate",
        "meetingOfficialName",
        "countryCode",
        "circuitKey",
        "circuitType",
        "circuitImage",
        "status",
        "statusNote",
        "sessions"
      ]
    }
  },
  "required": [
    "year",
    "raceWeekend"
  ],
  "$defs": {
    "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"
      ]
    }
  }
}