{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://racingapi.com/assets/data/racing-sample.schema.json",
  "title": "RacingAPI.com fictional fixture envelope v1",
  "description": "An educational fixture contract, not a real provider API contract. sport_data is an explicitly open, discipline-specific object.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "sample",
    "source",
    "event",
    "classification_status",
    "results",
    "sport_data"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0.0"
    },
    "sample": {
      "const": true
    },
    "source": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "observed_at",
        "revision"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "observed_at": {
          "type": "string",
          "format": "date-time"
        },
        "revision": {
          "type": "string"
        }
      }
    },
    "event": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "discipline",
        "scheduled_start",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "discipline": {
          "enum": [
            "car",
            "f1",
            "nascar",
            "horse",
            "dog",
            "boat",
            "virtual",
            "marathon",
            "running"
          ]
        },
        "scheduled_start": {
          "type": "string",
          "format": "date-time"
        },
        "status": {
          "enum": [
            "scheduled",
            "in_progress",
            "suspended",
            "completed",
            "cancelled"
          ]
        }
      }
    },
    "classification_status": {
      "enum": [
        "not_available",
        "provisional",
        "final"
      ]
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entry_id",
          "position",
          "name",
          "elapsed_ms",
          "status"
        ],
        "properties": {
          "entry_id": {
            "type": "string"
          },
          "position": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "elapsed_ms": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "status": {
            "enum": [
              "classified",
              "not_started",
              "not_finished",
              "disqualified",
              "pending"
            ]
          }
        }
      }
    },
    "sport_data": {
      "type": "object",
      "additionalProperties": true
    }
  }
}