{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sportstatsapi/json-schema/sportstatsapi-dto-motorsport-session-output-schema.json",
  "title": "dto.MotorsportSessionOutput",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sportstatsapi-motorsport-api-openapi.yml#/components/schemas/dto.MotorsportSessionOutput",
  "properties": {
    "distance": {
      "description": "km",
      "type": "string"
    },
    "event_id": {
      "type": "integer"
    },
    "fastest_lap": {
      "type": "string"
    },
    "has_results": {
      "type": "boolean"
    },
    "id": {
      "type": "integer"
    },
    "kind": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "results": {
      "items": {
        "$ref": "#/$defs/database.MotorsportResult"
      },
      "type": "array"
    },
    "start": {
      "description": "UTC",
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "total_laps": {
      "type": "integer"
    },
    "updated_at": {
      "type": "string"
    }
  },
  "type": "object",
  "$defs": {
    "database.MotorsportResult": {
      "properties": {
        "country": {
          "description": "as the feed writes it: NED, Esp, Brazil",
          "type": "string"
        },
        "driver": {
          "type": "string"
        },
        "driver_id": {
          "type": "integer"
        },
        "grid": {
          "type": "integer"
        },
        "laps": {
          "type": "integer"
        },
        "pit_stops": {
          "type": "integer"
        },
        "position": {
          "type": "integer"
        },
        "status": {
          "type": "string"
        },
        "team": {
          "type": "string"
        },
        "team_id": {
          "type": "integer"
        },
        "time": {
          "description": "winner's time, gap (\"+1.363\", \"1 Lap\") or best lap",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}