115 lines
2.6 KiB
YAML
115 lines
2.6 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:
|
|
/users:
|
|
get:
|
|
summary: Get Users
|
|
description: Returns all users
|
|
parameters: []
|
|
operationId: ""
|
|
responses:
|
|
"200":
|
|
description: Default response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/UsersListResponse"
|
|
"401":
|
|
description: Not allowed
|
|
tags:
|
|
- Users
|
|
security:
|
|
- BasicAuth: []
|
|
put:
|
|
summary: Add User
|
|
description: Add a new user
|
|
parameters: []
|
|
operationId: ""
|
|
responses:
|
|
"200":
|
|
description: Default response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/TrueResponse"
|
|
"401":
|
|
description: Not allowed
|
|
"500":
|
|
description: Error
|
|
tags:
|
|
- Users
|
|
security:
|
|
- BasicAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/UserAddBody"
|
|
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:
|
|
UsersListResponse:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/UserType"
|
|
UserType:
|
|
type: object
|
|
properties:
|
|
ID:
|
|
type: number
|
|
description: User ID
|
|
example: 1
|
|
FirstName:
|
|
type: string
|
|
description: Given name of user
|
|
example: Max
|
|
LastName:
|
|
type: string
|
|
description: Family name of User
|
|
example: Mustermann
|
|
token:
|
|
type: string
|
|
description: Access Token
|
|
format: uuid
|
|
example: 3be6453c-03eb-4357-ae5a-984a0e574a54
|
|
UserAddBody:
|
|
type: object
|
|
required:
|
|
- FirstName
|
|
- LastName
|
|
properties:
|
|
FirstName:
|
|
type: string
|
|
description: Given name of user
|
|
example: Max
|
|
LastName:
|
|
type: string
|
|
description: Family name of User
|
|
example: Mustermann
|
|
TrueResponse:
|
|
type: boolean
|
|
example: true
|
|
securitySchemes:
|
|
BasicAuth:
|
|
type: apiKey
|
|
name: token
|
|
in: header
|
|
tags:
|
|
- name: Users
|
|
- name: Posts
|