PHP-Course/exam/api/docs/api.yaml
2024-07-21 15:49:43 +02:00

115 lines
2.7 KiB
YAML

openapi: 3.0.0
info:
title: PHP Course Exam
version: 1.0.0
contact:
name: Kilian Kurt Hofmann
email: khofmann@zedat.fu-berlin.de
description: PHP Course (ABV FU Berlin) 2024 Exam
paths:
/login:
post:
summary: Login
description: Log in user
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/LoginRequest"
responses:
200:
description: Success
content:
application/json:
schema:
$ref: "#/components/schemas/BooleanResponse"
examples:
Success:
value: true
401:
description: Invalid credentials
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
Invalid Username or Password:
value: { "message": "Invalid Username or Password" }
404:
description: User not Found
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
User not Found:
value: { "message": "User not Found" }
500:
description: Failed
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
Failed:
value: { "message": "Login failed" }
tags:
- Login/Logout
/logout:
post:
summary: Logout
description: Log out User
security:
- BasicAuth: []
responses:
200:
description: Success
content:
application/json:
schema:
$ref: "#/components/schemas/BooleanResponse"
examples:
Success:
value: true
tags:
- Login/Logout
externalDocs:
url: https://khofmann.userpage.fu-berlin.de/phpCourse/exam/api/docs/
security: []
servers:
- url: https://khofmann.userpage.fu-berlin.de/phpCourse/exam/api/
description: ""
variables: {}
components:
links: {}
callbacks: {}
schemas:
BooleanResponse:
type: boolean
ErrorResponse:
type: object
properties:
message:
type: string
LoginRequest:
type: object
required:
- username
- password
properties:
username:
type: string
password:
type: string
securitySchemes:
BasicAuth:
type: apiKey
name: token
in: header
tags:
- name: Login/Logout
- name: Users
- name: Posts