forked from WEB-IB-SS26/development-ib
96 lines
1.9 KiB
JSON
96 lines
1.9 KiB
JSON
{
|
|
"openapi": "3.0.0",
|
|
"info": {
|
|
"title": "Workshop API",
|
|
"version": "1.0.0"
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "localhost:8080"
|
|
}
|
|
],
|
|
"paths": {
|
|
"/signup": {
|
|
"post": {
|
|
"summary": "Erstellt eine Session für eine:n Benutzer:in.",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/UserData"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"text/html": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"content": {
|
|
"text/html": {
|
|
"schema": {
|
|
"type": "string",
|
|
"example": "Daten konnten nicht verarbeitet werden."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/whoami": {
|
|
"get": {
|
|
"summary": "Liefert eine Nachricht an eine:n Benutzer:in zurück.",
|
|
"description": "Falls der/die Benutzer:in sich über einen signup-Request bereits registriert hat, erhält er/sie eine Nachricht unter Nennung des Spitznamens und der Information, ob er/sie als Admin registriert ist.",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Nachricht an registrierte Benutzer:innen",
|
|
"content": {
|
|
"text/html": {
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"example": "Hallo Karla!\nDu bist als Admin registriert."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"schemas": {
|
|
"UserData": {
|
|
"type": "object",
|
|
"required": [
|
|
"username",
|
|
"nickname"
|
|
],
|
|
"properties": {
|
|
"username": {
|
|
"type": "string",
|
|
"example": "fischauge12345"
|
|
},
|
|
"nickname": {
|
|
"type": "string",
|
|
"example": "Karla"
|
|
},
|
|
"admin": {
|
|
"type": "boolean",
|
|
"example": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |