API: Documented additional endpoints in OpenAPI

This commit is contained in:
Igor Scheller 2023-07-19 21:30:07 +02:00 committed by Michael Weimann
parent e2e18db460
commit 1505d0229d
2 changed files with 173 additions and 2 deletions

View File

@ -22,7 +22,9 @@ servers:
tags: tags:
- name: news - name: news
description: News and Meeting announcements description: News and meeting announcements
- name: shift
description: Event shifts and location
components: components:
securitySchemes: securitySchemes:
@ -52,6 +54,15 @@ components:
$ref: '#/components/schemas/Error' $ref: '#/components/schemas/Error'
schemas: schemas:
AngelType:
type: object
properties:
id:
type: integer
example: 42
name:
type: string
example: Angel
Error: Error:
type: object type: object
properties: properties:
@ -90,11 +101,124 @@ components:
type: string type: string
nullable: true nullable: true
example: 2023-05-13T23:00:00.000000Z example: 2023-05-13T23:00:00.000000Z
Room:
type: object
properties:
id:
type: integer
example: 42
name:
type: string
example: Heaven
Shift:
type: object
properties:
id:
type: integer
example: 42
title:
type: string
example: Cleanup the venue
description:
type: string
example: You clean up the venue after the event, its fun, we promise!
start:
type: string
example: 2023-05-13T14:00:00.000000Z
end:
type: string
example: 2023-05-13T16:00:00.000000Z23
entries:
type: array
items:
$ref: '#/components/schemas/ShiftEntry'
room:
$ref: '#/components/schemas/Room'
shift_type:
$ref: '#/components/schemas/ShiftType'
created_at:
type: string
nullable: true
example: 2023-05-13T13:37:42.000000Z
updated_at:
type: string
nullable: true
example: 2023-05-13T23:00:00.000000Z
ShiftEntry:
type: object
properties:
user:
$ref: '#/components/schemas/User'
type:
$ref: '#/components/schemas/AngelType'
ShiftType:
type: object
properties:
id:
type: integer
example: 42
name:
type: string
example: Build-Up
description:
type: string
example: This is a generic build-up shift, mostly involving heavy lifting.
User:
type: object
properties:
id:
type: integer
example: 42
name:
type: string
example: HelpfulUser
first_name:
type: string
nullable: true
example: Helpful
last_name:
type: string
nullable: true
example: User
pronoun:
type: string
nullable: true
example: They/Them
contact:
type: object
properties:
dect:
type: string
nullable: true
example: 4242
mobile:
type: string
nullable: true
example: 1234567890
security: security:
- bearerAuth: [ ] - bearerAuth: [ ]
paths: paths:
/angeltypes:
get:
tags:
- shift
summary: Get a list of angeltypes
responses:
'200':
description: Ok
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/AngelType'
'401':
$ref: '#/components/responses/UnauthorizedError'
'403':
$ref: '#/components/responses/ForbiddenError'
/news: /news:
get: get:
tags: tags:
@ -113,3 +237,49 @@ paths:
$ref: '#/components/responses/UnauthorizedError' $ref: '#/components/responses/UnauthorizedError'
'403': '403':
$ref: '#/components/responses/ForbiddenError' $ref: '#/components/responses/ForbiddenError'
/rooms:
get:
tags:
- shift
summary: Get a list of rooms
responses:
'200':
description: Ok
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Room'
'401':
$ref: '#/components/responses/UnauthorizedError'
'403':
$ref: '#/components/responses/ForbiddenError'
/rooms/{id}/shifts:
parameters:
- name: id
in: path
required: true
description: the room identifier
example: 42
schema:
type: integer
get:
tags:
- shift
summary: Get all shifts in the room
responses:
'200':
description: Ok
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Shift'
'401':
$ref: '#/components/responses/UnauthorizedError'
'403':
$ref: '#/components/responses/ForbiddenError'

View File

@ -3,4 +3,5 @@ Here you can find the OpenAPI files that describe the Engelsystem API.
Please be aware that the API is still in Beta and might change every second (but we try to keep it consistent during events ;)) Please be aware that the API is still in Beta and might change every second (but we try to keep it consistent during events ;))
## Links ## Links
* [OpenAPI Spec](https://swagger.io/specification/) * [Engelsystem OpenApi](openapi.yml)
* [OpenAPI format specification](https://swagger.io/specification/)