forked from Roflin/gamenight
234 lines
5.7 KiB
YAML
234 lines
5.7 KiB
YAML
openapi: 3.0.0
|
|
info:
|
|
title: Gamenight
|
|
version: '1.0'
|
|
contact:
|
|
name: Dennis Brentjes
|
|
email: dennis@brentj.es
|
|
url: 'https://brentj.es'
|
|
description: Api specifaction for a Gamenight server
|
|
license:
|
|
name: MIT
|
|
servers:
|
|
- url: 'http://localhost:8080'
|
|
description: Gamenight
|
|
paths:
|
|
/token:
|
|
get:
|
|
summary: ''
|
|
operationId: get-token
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/TokenResponse'
|
|
'401':
|
|
$ref: '#/components/responses/FailureResponse'
|
|
requestBody:
|
|
$ref: '#/components/requestBodies/LoginRequest'
|
|
description: Submit your credentials to get a JWT-token to use with the rest of the api.
|
|
parameters: []
|
|
/user:
|
|
post:
|
|
summary: ''
|
|
operationId: post-register
|
|
requestBody:
|
|
$ref: '#/components/requestBodies/RegisterRequest'
|
|
responses:
|
|
'200':
|
|
description: ''
|
|
'422':
|
|
$ref: '#/components/responses/FailureResponse'
|
|
description: 'Create a new user given a registration token and user information, username and email must be unique, and password and password_repeat must match.'
|
|
parameters: []
|
|
/gamenights:
|
|
get:
|
|
summary: Your GET endpoint
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/GamenightsResponse'
|
|
'400':
|
|
$ref: '#/components/responses/FailureResponse'
|
|
'401':
|
|
$ref: '#/components/responses/FailureResponse'
|
|
operationId: get-gamenights
|
|
security:
|
|
- JWT-Auth: []
|
|
description: Retrieve the list of gamenights on this gamenight server. Requires authorization.
|
|
/gamenight:
|
|
post:
|
|
summary: ''
|
|
operationId: post-gamenight
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
'401':
|
|
$ref: '#/components/responses/FailureResponse'
|
|
'422':
|
|
$ref: '#/components/responses/FailureResponse'
|
|
security:
|
|
- JWT-Auth: []
|
|
requestBody:
|
|
$ref: '#/components/requestBodies/AddGamenight'
|
|
description: 'Add a gamenight by providing a name and a date, only available when providing an JWT token.'
|
|
get:
|
|
summary: ''
|
|
operationId: get-gamenight
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/GamenightResponse'
|
|
'401':
|
|
$ref: '#/components/responses/FailureResponse'
|
|
'422':
|
|
$ref: '#/components/responses/FailureResponse'
|
|
requestBody:
|
|
$ref: '#/components/requestBodies/GetGamenight'
|
|
security:
|
|
- JWT-Auth: []
|
|
components:
|
|
schemas:
|
|
Gamenight:
|
|
title: Gamenight
|
|
x-stoplight:
|
|
id: 0nmru75ph5wh3
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
datetime:
|
|
type: string
|
|
owner_id:
|
|
type: string
|
|
required:
|
|
- id
|
|
- name
|
|
- datetime
|
|
- owner_id
|
|
Failure:
|
|
title: Failure
|
|
type: object
|
|
properties:
|
|
message:
|
|
type: string
|
|
description: ''
|
|
Token:
|
|
title: Token
|
|
x-stoplight:
|
|
id: 8pz19kigm1jer
|
|
type: object
|
|
properties:
|
|
jwt_token:
|
|
type: string
|
|
Login:
|
|
title: Login
|
|
type: object
|
|
properties:
|
|
username:
|
|
type: string
|
|
password:
|
|
type: string
|
|
required:
|
|
- username
|
|
- password
|
|
Registration:
|
|
title: Registration
|
|
type: object
|
|
properties:
|
|
username:
|
|
type: string
|
|
email:
|
|
type: string
|
|
password:
|
|
type: string
|
|
password_repeat:
|
|
type: string
|
|
registration_token:
|
|
type: string
|
|
required:
|
|
- username
|
|
- email
|
|
- password
|
|
- password_repeat
|
|
- registration_token
|
|
AddGamenightRequestBody:
|
|
title: AddGamenightRequestBody
|
|
x-stoplight:
|
|
id: xw4z5jyym8q7r
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
x-stoplight:
|
|
id: s5ny76cy54nty
|
|
datetime:
|
|
type: string
|
|
x-stoplight:
|
|
id: dh6vyvulj4xze
|
|
x-internal: false
|
|
requestBodies:
|
|
LoginRequest:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Login'
|
|
RegisterRequest:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Registration'
|
|
AddGamenight:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/AddGamenightRequestBody'
|
|
GetGamenight:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
responses:
|
|
TokenResponse:
|
|
description: Example response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Token'
|
|
FailureResponse:
|
|
description: Example response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Failure'
|
|
application/xml:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
message:
|
|
type: string
|
|
required:
|
|
- message
|
|
GamenightsResponse:
|
|
description: Example response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Gamenight'
|
|
GamenightResponse:
|
|
description: Example response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Gamenight'
|
|
securitySchemes:
|
|
JWT-Auth:
|
|
type: http
|
|
scheme: bearer
|
|
bearerFormat: JWT
|
|
description: ''
|
|
|