Added backend and fixed openapi generation

This commit is contained in:
2025-04-08 22:24:24 +02:00
parent 21496baab5
commit 67a3162ae3
21 changed files with 405 additions and 157 deletions
+109
View File
@@ -0,0 +1,109 @@
openapi: 3.0.4
info:
title: Altitude Web API
description: |-
The API for the Altitude website
version: 1.0.0
servers:
- url: https://alttd.com/api/v3
tags:
- name: player
description: Retrieve player information
paths:
/player/teamMembers/{group}:
get:
tags:
- team
summary: Get team members
description: Retrieve players who are part of the specified team
operationId: getTeamMembers
parameters:
- name: group
in: path
required: true
description: The group name of the team
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/TeamMembers'
default:
description: Unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/player/history:
post:
tags:
- user
summary: Get player history
description: Retrieves all types of player history about the player
operationId: getPlayerHistory
requestBody:
description: The player history
content:
application/json:
schema:
$ref: '#/components/schemas/Player'
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/PlayerHistory'
default:
description: Unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
schemas:
Player:
type: object
properties:
uuid:
type: string
example: 0c35e520-927e-4c6a-87ad-ff0739c22e9d
PlayerHistory:
type: object
properties:
punishmentType:
type: string
punishment:
type: string
active:
type: boolean
start:
type: integer
format: int64
duration:
type: integer
format: int64
TeamMembers:
type: array
items:
$ref: '#/components/schemas/TeamMember'
TeamMember:
type: object
properties:
name:
type: string
description: The name of the team member
group:
type: string
description: The group to which the team member belongs
required:
- name
- group
Error:
type: object
properties:
reason:
type: string