{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/racecalendar-app/json-schema/racecalendar-app-historical-web-data-payload-schema.json",
  "title": "HistoricalWebDataPayload",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/racecalendar-app-openapi.yml#/components/schemas/HistoricalWebDataPayload",
  "type": "object",
  "properties": {
    "generatedAt": {
      "type": "string"
    },
    "qualifyingResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HistoricalWebQualifyingResult"
      }
    },
    "raceResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HistoricalWebRaceResult"
      }
    },
    "seasons": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HistoricalWebSeason"
      }
    },
    "source": {
      "$ref": "#/$defs/HistoricalWebDataSource"
    }
  },
  "required": [
    "generatedAt",
    "qualifyingResults",
    "raceResults",
    "seasons",
    "source"
  ],
  "$defs": {
    "HistoricalWebConstructorStanding": {
      "type": "object",
      "properties": {
        "constructorId": {
          "type": "string"
        },
        "constructorName": {
          "type": "string"
        },
        "nationality": {
          "type": "string"
        },
        "points": {
          "type": "number"
        },
        "position": {
          "type": "number"
        },
        "wins": {
          "type": "number"
        }
      },
      "required": [
        "constructorId",
        "constructorName",
        "nationality",
        "points",
        "position",
        "wins"
      ]
    },
    "HistoricalWebDataSource": {
      "type": "object",
      "properties": {
        "artifactSha256": {
          "type": "string"
        },
        "commit": {
          "type": "string"
        },
        "license": {
          "type": "string",
          "enum": [
            "CC BY 4.0"
          ]
        },
        "licenseUrl": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "enum": [
            "F1DB"
          ]
        },
        "publishedAt": {
          "type": "string"
        },
        "releaseUrl": {
          "type": "string"
        },
        "repositoryUrl": {
          "type": "string"
        },
        "version": {
          "type": "string"
        }
      },
      "required": [
        "artifactSha256",
        "commit",
        "license",
        "licenseUrl",
        "name",
        "publishedAt",
        "releaseUrl",
        "repositoryUrl",
        "version"
      ]
    },
    "HistoricalWebDriverStanding": {
      "type": "object",
      "properties": {
        "constructors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "driverCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "driverId": {
          "type": "string"
        },
        "fullName": {
          "type": "string"
        },
        "nationality": {
          "type": "string"
        },
        "points": {
          "type": "number"
        },
        "position": {
          "type": "number"
        },
        "wins": {
          "type": "number"
        }
      },
      "required": [
        "constructors",
        "driverCode",
        "driverId",
        "fullName",
        "nationality",
        "points",
        "position",
        "wins"
      ]
    },
    "HistoricalWebQualifyingResult": {
      "type": "object",
      "properties": {
        "format": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "pre-qualifying",
            "qualifying"
          ]
        },
        "r": {
          "type": "number"
        },
        "rows": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HistoricalWebQualifyingResultRow"
          }
        },
        "y": {
          "type": "number"
        }
      },
      "required": [
        "format",
        "kind",
        "r",
        "rows",
        "y"
      ]
    },
    "HistoricalWebQualifyingResultRow": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": [
              "string",
              "null"
            ]
          },
          {
            "type": [
              "number",
              "null"
            ]
          }
        ]
      },
      "minItems": 15,
      "maxItems": 15
    },
    "HistoricalWebRace": {
      "type": "object",
      "properties": {
        "circuitId": {
          "type": "string"
        },
        "circuitName": {
          "type": "string"
        },
        "countryName": {
          "type": "string"
        },
        "date": {
          "type": "string"
        },
        "locality": {
          "type": "string"
        },
        "raceName": {
          "type": "string"
        },
        "round": {
          "type": "number"
        },
        "url": {
          "type": "string"
        },
        "winnerConstructorName": {
          "type": [
            "string",
            "null"
          ]
        },
        "winnerName": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "circuitId",
        "circuitName",
        "countryName",
        "date",
        "locality",
        "raceName",
        "round",
        "url",
        "winnerConstructorName",
        "winnerName"
      ]
    },
    "HistoricalWebRaceFastestLap": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "lap": {
          "type": [
            "number",
            "null"
          ]
        },
        "rank": {
          "type": [
            "number",
            "null"
          ]
        },
        "speed": {
          "type": [
            "number",
            "null"
          ]
        },
        "time": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "lap",
        "rank",
        "speed",
        "time"
      ]
    },
    "HistoricalWebRaceResult": {
      "type": "object",
      "properties": {
        "r": {
          "type": "number"
        },
        "rows": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HistoricalWebRaceResultRow"
          }
        },
        "y": {
          "type": "number"
        }
      },
      "required": [
        "r",
        "rows",
        "y"
      ]
    },
    "HistoricalWebRaceResultRow": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": [
              "string",
              "null"
            ]
          },
          {
            "$ref": "#/$defs/HistoricalWebRaceFastestLap"
          },
          {
            "type": [
              "number",
              "null"
            ]
          },
          {
            "type": "number"
          }
        ]
      },
      "minItems": 17,
      "maxItems": 17
    },
    "HistoricalWebSeason": {
      "type": "object",
      "properties": {
        "constructorStandings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HistoricalWebConstructorStanding"
          }
        },
        "driverStandings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HistoricalWebDriverStanding"
          }
        },
        "races": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HistoricalWebRace"
          }
        },
        "seasonUrl": {
          "type": "string"
        },
        "year": {
          "type": "number"
        }
      },
      "required": [
        "constructorStandings",
        "driverStandings",
        "races",
        "seasonUrl",
        "year"
      ]
    }
  }
}