250 lines
6.5 KiB
YAML
250 lines
6.5 KiB
YAML
openapi: 3.0.0
|
|
x-stoplight:
|
|
id: w776sltk0h1bo
|
|
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/Login'
|
|
description: Submit your credentials to get a JWT-token to use with the rest of the api.
|
|
/user:
|
|
post:
|
|
summary: ''
|
|
operationId: post-register
|
|
requestBody:
|
|
$ref: '#/components/requestBodies/Register'
|
|
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
|
|
x-stoplight:
|
|
id: 3bd6bux9juutk
|
|
name:
|
|
type: string
|
|
x-stoplight:
|
|
id: hp3ulebe5l5k2
|
|
datetime:
|
|
type: string
|
|
x-stoplight:
|
|
id: qrae8k13mit85
|
|
owner_id:
|
|
type: string
|
|
x-stoplight:
|
|
id: q8g2pnzqx4byh
|
|
required:
|
|
- id
|
|
- name
|
|
- datetime
|
|
- owner_id
|
|
requestBodies:
|
|
Login:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
username:
|
|
type: string
|
|
x-stoplight:
|
|
id: hvemn3s02e6h2
|
|
password:
|
|
type: string
|
|
x-stoplight:
|
|
id: yx02fdolrp9rj
|
|
required:
|
|
- username
|
|
- password
|
|
Register:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
username:
|
|
type: string
|
|
x-stoplight:
|
|
id: el8e6kdc6xgmw
|
|
email:
|
|
type: string
|
|
x-stoplight:
|
|
id: ipexmxasalhym
|
|
password:
|
|
type: string
|
|
x-stoplight:
|
|
id: 5fztmf9jhd7dt
|
|
password_repeat:
|
|
type: string
|
|
x-stoplight:
|
|
id: xw1skr0mjujuq
|
|
registration_token:
|
|
type: string
|
|
x-stoplight:
|
|
id: kvq6rzg1fcn7s
|
|
required:
|
|
- username
|
|
- email
|
|
- password
|
|
- password_repeat
|
|
- registration_token
|
|
AddGamenight:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
x-stoplight:
|
|
id: ak4fkyj5haj8k
|
|
datetime:
|
|
type: string
|
|
x-stoplight:
|
|
id: 3dylqwf2yuyku
|
|
GetGamenight:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
x-stoplight:
|
|
id: qykfde4zkqfgx
|
|
responses:
|
|
TokenResponse:
|
|
description: Example response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
jwt_token:
|
|
type: string
|
|
x-stoplight:
|
|
id: qyp2q6rqsk1ql
|
|
required:
|
|
- jwt_token
|
|
FailureResponse:
|
|
description: Example response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
message:
|
|
type: string
|
|
x-stoplight:
|
|
id: g1la0pt0erd0b
|
|
application/xml:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
message:
|
|
type: string
|
|
x-stoplight:
|
|
id: ir85ew0w88sv7
|
|
required:
|
|
- message
|
|
GamenightsResponse:
|
|
description: Example response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
gamenights:
|
|
x-stoplight:
|
|
id: t1i2zjid122y2
|
|
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: ''
|