{
  "openapi": "3.0.2",
  "info": {
    "title": "driftapi reference implementation",
    "version": "1.4.13"
  },
  "paths": {
    "/game/{game_id}/ping": {
      "get": {
        "tags": [
          "community_api"
        ],
        "summary": "Ping",
        "description": "Ping that is used from the app to determine if a race with this uri and race id exists. The response is used to synchronize the race settings in the app, see example response. All fields in the response are optional.",
        "operationId": "ping_game__game_id__ping_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Game Id",
              "type": "string"
            },
            "name": "game_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PingResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/game/{game_id}/enter": {
      "post": {
        "tags": [
          "community_api"
        ],
        "summary": "Create Enterevent",
        "description": "<p>This event is triggered when the user starts a run (free run, race, gymkhana) and after the loading is completed (the user sees the hud of the racer)</p><p>it's purpose is for the server to control the car setup and if that matches with what is allowed for the race</p>",
        "operationId": "create_EnterEvent_game__game_id__enter_post",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Game Id",
              "type": "string"
            },
            "name": "game_id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnterEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/game/{game_id}/start": {
      "post": {
        "tags": [
          "community_api"
        ],
        "summary": "Create Startevent",
        "description": "This event is triggered when the user hits the 'Start Motor' button the first time.",
        "operationId": "create_StartEvent_game__game_id__start_post",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Game Id",
              "type": "string"
            },
            "name": "game_id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/game/{game_id}/target": {
      "post": {
        "tags": [
          "community_api"
        ],
        "summary": "Create Targetevent",
        "description": "This event is triggered whenever a target is recognized",
        "operationId": "create_TargetEvent_game__game_id__target_post",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Game Id",
              "type": "string"
            },
            "name": "game_id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TargetEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/game/{game_id}/end": {
      "post": {
        "tags": [
          "community_api"
        ],
        "summary": "Create Endevent",
        "description": "This event is triggered whenever a player shuts down the motor and finishes the run",
        "operationId": "create_EndEvent_game__game_id__end_post",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Game Id",
              "type": "string"
            },
            "name": "game_id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EndEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/": {
      "get": {
        "tags": [
          "racingserver_api"
        ],
        "summary": "Root",
        "description": "Entry endpoint that directs to the openapi docs.",
        "operationId": "root__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/game/{game_id}/events": {
      "put": {
        "tags": [
          "racingserver_api"
        ],
        "summary": "Get Events",
        "description": "This is a debug function that you can use to query for the created race events.",
        "operationId": "get_Events_game__game_id__events_put",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Game Id",
              "type": "string"
            },
            "name": "game_id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "title": "Query",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/game/{game_id}/playerstatus": {
      "get": {
        "tags": [
          "racingserver_api"
        ],
        "summary": "Get Scoreboard",
        "operationId": "get_scoreboard_game__game_id__playerstatus_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Game Id",
              "type": "string"
            },
            "name": "game_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/manage_game/create": {
      "post": {
        "tags": [
          "racingserver_api"
        ],
        "summary": "Create Game",
        "operationId": "create_game_manage_game_create_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Game"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/manage_game/delete/{game_id}": {
      "get": {
        "tags": [
          "racingserver_api"
        ],
        "summary": "Delete Game",
        "operationId": "delete_game_manage_game_delete__game_id__get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Game Id",
              "type": "string"
            },
            "name": "game_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/manage_game/reset/{game_id}": {
      "get": {
        "tags": [
          "racingserver_api"
        ],
        "summary": "Reset Game",
        "operationId": "reset_game_manage_game_reset__game_id__get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Game Id",
              "type": "string"
            },
            "name": "game_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/manage_game/reset_player/{game_id}/{user_name}": {
      "get": {
        "tags": [
          "racingserver_api"
        ],
        "summary": "Reset Player",
        "operationId": "reset_player_manage_game_reset_player__game_id___user_name__get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Game Id",
              "type": "string"
            },
            "name": "game_id",
            "in": "path"
          },
          {
            "required": true,
            "schema": {
              "title": "User Name",
              "type": "string"
            },
            "name": "user_name",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/manage_game/get/{game_id}/": {
      "get": {
        "tags": [
          "racingserver_api"
        ],
        "summary": "Get Game",
        "operationId": "get_game_manage_game_get__game_id___get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Game Id",
              "type": "string"
            },
            "name": "game_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/manage_game/find/": {
      "post": {
        "tags": [
          "racingserver_api"
        ],
        "summary": "Find Game",
        "operationId": "find_game_manage_game_find__post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "title": "Query",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EndData": {
        "title": "EndData",
        "required": [
          "finished_time"
        ],
        "type": "object",
        "properties": {
          "finished_time": {
            "title": "Finished Time",
            "type": "string",
            "format": "date-time"
          },
          "false_start": {
            "title": "This is true whenever a false start was detected at the beginning of the race.",
            "type": "boolean",
            "example": false
          },
          "total_score": {
            "title": "The total achieved score at the very end.",
            "type": "integer",
            "example": 1000
          },
          "total_driven_distance": {
            "title": "The distance driven in this race",
            "type": "number",
            "example": 123
          },
          "total_driven_time": {
            "title": "Time in seconds the player was driving so far in this race",
            "type": "number",
            "example": 122
          }
        }
      },
      "EndEvent": {
        "title": "EndEvent",
        "required": [
          "data"
        ],
        "type": "object",
        "properties": {
          "app_version": {
            "title": "A string representing the app version the user is running.",
            "type": "string",
            "example": "V.1.14.15_A"
          },
          "game_id": {
            "title": "The id of the game that has been opened. This should be the same as the one provided via the uri.",
            "type": "string",
            "example": "Race1"
          },
          "user_id": {
            "title": "unique user id",
            "type": "string",
            "description": "unique identifier (for the duration of the current race), can and should be different from the Sturmkind user name for legal and security reasons, for example a hash of the username or a hash of the devices ip address.",
            "format": "uuid"
          },
          "user_name": {
            "title": "the name choosen by the user to be displayed on the scoreboard",
            "type": "string",
            "description": "Can be different from the Sturmkind user name (for legal reasons)",
            "example": "PlayerNo1"
          },
          "time": {
            "title": "the exact timestamp down to the precision the sturmkind app uses, so fractions of a second",
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "$ref": "#/components/schemas/EndData"
          }
        }
      },
      "EnterData": {
        "title": "EnterData",
        "required": [
          "game_mode",
          "track_condition",
          "track_bundle",
          "wheels",
          "setup_mode"
        ],
        "type": "object",
        "properties": {
          "game_mode": {
            "$ref": "#/components/schemas/game_mode"
          },
          "start_time": {
            "title": "Start Time",
            "type": "string",
            "format": "date-time"
          },
          "lap_count": {
            "title": "number of rounds (for the race mode)",
            "type": "integer"
          },
          "track_condition": {
            "$ref": "#/components/schemas/track_condition"
          },
          "track_bundle": {
            "$ref": "#/components/schemas/track_bundle"
          },
          "wheels": {
            "$ref": "#/components/schemas/wheels"
          },
          "setup_mode": {
            "$ref": "#/components/schemas/setup_mode"
          },
          "engine_type": {
            "title": "The id of the motor type. No ENUM because this might get extended. Example: 'DTM', 'V8' etc.",
            "type": "string",
            "example": "V8"
          },
          "tuning_type": {
            "title": "The id of the motor setup. No ENUM because this might get extended.",
            "type": "string",
            "example": "BASIC SETUP 550 PS"
          },
          "steering_angle": {
            "title": "the choosen steering angle as set in the settings menue of the app",
            "type": "number",
            "example": 70
          },
          "softsteering": {
            "title": "if softsteering is enabled in the settings menue of the app.",
            "type": "boolean",
            "example": false
          },
          "driftassist": {
            "title": "if driftassist is enabled in the settings menue of the app.",
            "type": "boolean",
            "example": true
          },
          "car_name": {
            "title": "The name of the car as set by the player.",
            "type": "string",
            "example": "Yellow Beast"
          }
        }
      },
      "EnterEvent": {
        "title": "EnterEvent",
        "required": [
          "data"
        ],
        "type": "object",
        "properties": {
          "app_version": {
            "title": "A string representing the app version the user is running.",
            "type": "string",
            "example": "V.1.14.15_A"
          },
          "game_id": {
            "title": "The id of the game that has been opened. This should be the same as the one provided via the uri.",
            "type": "string",
            "example": "Race1"
          },
          "user_id": {
            "title": "unique user id",
            "type": "string",
            "description": "unique identifier (for the duration of the current race), can and should be different from the Sturmkind user name for legal and security reasons, for example a hash of the username or a hash of the devices ip address.",
            "format": "uuid"
          },
          "user_name": {
            "title": "the name choosen by the user to be displayed on the scoreboard",
            "type": "string",
            "description": "Can be different from the Sturmkind user name (for legal reasons)",
            "example": "PlayerNo1"
          },
          "time": {
            "title": "the exact timestamp down to the precision the sturmkind app uses, so fractions of a second",
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "$ref": "#/components/schemas/EnterData"
          }
        }
      },
      "Game": {
        "title": "Game",
        "required": [
          "game_id"
        ],
        "type": "object",
        "properties": {
          "game_id": {
            "title": "Game Id",
            "type": "string"
          },
          "start_time": {
            "title": "Start Time",
            "type": "string",
            "format": "date-time"
          },
          "start_delay": {
            "title": "Start Delay",
            "type": "number"
          },
          "track_id": {
            "title": "Track Id",
            "type": "string"
          },
          "time_limit": {
            "title": "the time limit for the run, in seconds",
            "type": "number"
          },
          "lap_count": {
            "title": "number of rounds (for the race mode)",
            "type": "integer"
          },
          "track_condition": {
            "$ref": "#/components/schemas/track_condition"
          },
          "track_bundle": {
            "$ref": "#/components/schemas/track_bundle"
          },
          "wheels": {
            "$ref": "#/components/schemas/wheels"
          },
          "setup_mode": {
            "$ref": "#/components/schemas/setup_mode"
          },
          "joker_lap_code": {
            "title": "if set, this target code counter is displayed to be used for joker-laps etc.",
            "type": "integer"
          },
          "joker_lap_precondition_code": {
            "title": "if set, this target code is required to be detected before the joker-lap code to count as actual joker lap.",
            "type": "integer"
          }
        }
      },
      "HTTPValidationError": {
        "title": "HTTPValidationError",
        "type": "object",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        }
      },
      "Orientation": {
        "title": "Orientation",
        "type": "object",
        "properties": {
          "speed": {
            "title": "speed in meter/second",
            "type": "number"
          },
          "angle": {
            "title": "angle, in degree, negative values for left-turns",
            "type": "number"
          }
        }
      },
      "PingResponse": {
        "title": "PingResponse",
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "boolean",
            "example": true
          },
          "start_time": {
            "title": "Start Time",
            "type": "string",
            "format": "date-time"
          },
          "start_delay": {
            "title": "Hidden start delay between the yellow and green race light. In the range of 0-2 seconds. This is added to the minimum of 1 second.",
            "type": "number"
          },
          "lap_count": {
            "title": "number of rounds (for the race mode)",
            "type": "integer"
          },
          "track_condition": {
            "$ref": "#/components/schemas/track_condition"
          },
          "track_bundle": {
            "$ref": "#/components/schemas/track_bundle"
          },
          "wheels": {
            "$ref": "#/components/schemas/wheels"
          },
          "setup_mode": {
            "$ref": "#/components/schemas/setup_mode"
          }
        }
      },
      "StartData": {
        "title": "StartData",
        "type": "object",
        "properties": {
          "signal_time": {
            "title": "The actual time if the signal lamp shows the green light.",
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "StartEvent": {
        "title": "StartEvent",
        "required": [
          "data"
        ],
        "type": "object",
        "properties": {
          "app_version": {
            "title": "A string representing the app version the user is running.",
            "type": "string",
            "example": "V.1.14.15_A"
          },
          "game_id": {
            "title": "The id of the game that has been opened. This should be the same as the one provided via the uri.",
            "type": "string",
            "example": "Race1"
          },
          "user_id": {
            "title": "unique user id",
            "type": "string",
            "description": "unique identifier (for the duration of the current race), can and should be different from the Sturmkind user name for legal and security reasons, for example a hash of the username or a hash of the devices ip address.",
            "format": "uuid"
          },
          "user_name": {
            "title": "the name choosen by the user to be displayed on the scoreboard",
            "type": "string",
            "description": "Can be different from the Sturmkind user name (for legal reasons)",
            "example": "PlayerNo1"
          },
          "time": {
            "title": "the exact timestamp down to the precision the sturmkind app uses, so fractions of a second",
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "$ref": "#/components/schemas/StartData"
          }
        }
      },
      "TargetData": {
        "title": "TargetData",
        "required": [
          "crossing_time",
          "target_code"
        ],
        "type": "object",
        "properties": {
          "crossing_time": {
            "title": "Crossing Time",
            "type": "string",
            "format": "date-time"
          },
          "target_code": {
            "$ref": "#/components/schemas/target_code"
          },
          "false_start": {
            "title": "This is true whenever a false start was detected at the beginning of the race.",
            "type": "boolean",
            "example": false
          },
          "driven_distance": {
            "title": "The distance driven so far",
            "type": "number",
            "example": 23
          },
          "driven_time": {
            "title": "Time in seconds the player is driving so far in this race",
            "type": "number",
            "example": 42
          },
          "score": {
            "title": "Amount of points awarded for this target. Work in progress.",
            "type": "integer",
            "example": 100
          },
          "orientations": {
            "title": "a list of orientations, each orientation has a speed and angle value.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Orientation"
            }
          }
        }
      },
      "TargetEvent": {
        "title": "TargetEvent",
        "required": [
          "data"
        ],
        "type": "object",
        "properties": {
          "app_version": {
            "title": "A string representing the app version the user is running.",
            "type": "string",
            "example": "V.1.14.15_A"
          },
          "game_id": {
            "title": "The id of the game that has been opened. This should be the same as the one provided via the uri.",
            "type": "string",
            "example": "Race1"
          },
          "user_id": {
            "title": "unique user id",
            "type": "string",
            "description": "unique identifier (for the duration of the current race), can and should be different from the Sturmkind user name for legal and security reasons, for example a hash of the username or a hash of the devices ip address.",
            "format": "uuid"
          },
          "user_name": {
            "title": "the name choosen by the user to be displayed on the scoreboard",
            "type": "string",
            "description": "Can be different from the Sturmkind user name (for legal reasons)",
            "example": "PlayerNo1"
          },
          "time": {
            "title": "the exact timestamp down to the precision the sturmkind app uses, so fractions of a second",
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "$ref": "#/components/schemas/TargetData"
          }
        }
      },
      "ValidationError": {
        "title": "ValidationError",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "type": "object",
        "properties": {
          "loc": {
            "title": "Location",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        }
      },
      "game_mode": {
        "title": "game_mode",
        "enum": [
          "RACE",
          "GYMKHANA"
        ],
        "type": "string",
        "description": "An enumeration."
      },
      "setup_mode": {
        "title": "setup_mode",
        "enum": [
          "RACE",
          "DRIFT"
        ],
        "type": "string",
        "description": "An enumeration."
      },
      "target_code": {
        "title": "target_code",
        "enum": [
          0,
          4,
          5,
          6,
          7
        ],
        "type": "integer",
        "description": "An enumeration."
      },
      "track_bundle": {
        "title": "track_bundle",
        "enum": [
          "none",
          "rally",
          "rally_cross"
        ],
        "type": "string",
        "description": "An enumeration."
      },
      "track_condition": {
        "title": "track_condition",
        "enum": [
          "drift_asphalt",
          "drift_asphalt_wet",
          "drift_dirt",
          "drift_ice",
          "drift_sand"
        ],
        "type": "string",
        "description": "An enumeration."
      },
      "wheels": {
        "title": "wheels",
        "enum": [
          "normal",
          "spikes",
          "gravel_tires"
        ],
        "type": "string",
        "description": "An enumeration."
      }
    }
  },
  "tags": [
    {
      "name": "community_api",
      "description": "<p>part of the dr!ft community api</p>"
    },
    {
      "name": "racingserver_api",
      "description": "<p>NOT part of the dr!ft community api</p>"
    }
  ]
}