Add races results GET endpoints (by ID and last finished) and regenerate swagger specs

This commit is contained in:
2026-07-17 22:41:55 +04:00
parent c8ff4c04ad
commit 9c9632343d
10 changed files with 812 additions and 318 deletions
+84
View File
@@ -1190,6 +1190,40 @@
}
}
},
"/api/races/last": {
"get": {
"description": "Returns the details and podium/results of the most recently finished race.",
"produces": [
"application/json"
],
"tags": [
"races"
],
"summary": "Get the results of the last finished race",
"responses": {
"200": {
"description": "Last race results",
"schema": {
"$ref": "#/definitions/transport.LobbyRace"
}
},
"404": {
"description": "No finished races found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/races/plans": {
"get": {
"description": "Returns race plans in ascending start_at order. Pass back the `next_cursor` to get the next page.",
@@ -1532,6 +1566,56 @@
}
}
},
"/api/races/{id}": {
"get": {
"description": "Returns details of a single race by its ID. Works for both live and finished races.",
"produces": [
"application/json"
],
"tags": [
"races"
],
"summary": "Get results of a specific race by ID",
"parameters": [
{
"type": "string",
"description": "Race ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Race details",
"schema": {
"$ref": "#/definitions/transport.LobbyRace"
}
},
"400": {
"description": "Missing race id",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Race not found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/tracks": {
"get": {
"description": "Returns all tracks visible to the caller. Optional query filters: `scope=system|public|private`, `tag=\u003cstring\u003e`.",