2020-11-25 17:48:26 +01:00
|
|
|
openapi: 3.0.3
|
|
|
|
info:
|
|
|
|
title: onSpot Backend
|
|
|
|
description: Backend of onSpot
|
|
|
|
contact:
|
|
|
|
email: tormakristof@tormakristof.eu
|
|
|
|
license:
|
|
|
|
name: Apache 2.0
|
|
|
|
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
|
|
|
version: 1.0.0
|
|
|
|
servers:
|
|
|
|
- url: https://onspot.k8s.kmlabz.com
|
|
|
|
tags:
|
|
|
|
- name: backend
|
|
|
|
description: onSpot Backend interaction
|
|
|
|
paths:
|
|
|
|
/api/auth/login:
|
|
|
|
post:
|
|
|
|
tags:
|
|
|
|
- backend
|
|
|
|
summary: Logs on a user
|
|
|
|
operationId: logon
|
|
|
|
requestBody:
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/User'
|
|
|
|
required: true
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
description: successful operation
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/LoginToken'
|
|
|
|
401:
|
|
|
|
description: Incorrect credentials
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/ApiResponse'
|
|
|
|
417:
|
|
|
|
description: JSON invalid schema
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/ApiResponse'
|
2020-11-26 00:46:25 +01:00
|
|
|
delete:
|
2020-11-25 19:00:43 +01:00
|
|
|
tags:
|
|
|
|
- backend
|
|
|
|
summary: Logs out a user
|
|
|
|
operationId: logoff
|
|
|
|
responses:
|
2020-11-26 00:46:25 +01:00
|
|
|
204:
|
2020-11-25 19:00:43 +01:00
|
|
|
description: successful operation
|
|
|
|
401:
|
|
|
|
description: Incorrect credentials
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/ApiResponse'
|
|
|
|
|
2020-11-25 18:49:37 +01:00
|
|
|
/api/auth/me:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- backend
|
|
|
|
summary: Current user
|
|
|
|
operationId: currentUser
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
description: successful operation
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/UserName'
|
|
|
|
401:
|
|
|
|
description: Unauthorized
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/ApiResponse'
|
|
|
|
|
2020-11-25 17:48:26 +01:00
|
|
|
/api/lists:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- backend
|
|
|
|
summary: Gets all lists
|
|
|
|
operationId: getAllLists
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
description: Lists
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
2020-11-26 02:31:14 +01:00
|
|
|
$ref: '#/components/schemas/MainList'
|
2020-11-25 17:48:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
/api/lists/{listid}:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- backend
|
|
|
|
summary: Gets a single lists
|
|
|
|
operationId: getList
|
|
|
|
parameters:
|
|
|
|
- name: listid
|
|
|
|
in: path
|
|
|
|
description: ID of a list
|
|
|
|
required: true
|
|
|
|
schema:
|
2020-11-26 01:40:58 +01:00
|
|
|
type: string
|
|
|
|
format: uuid
|
2020-11-26 02:31:14 +01:00
|
|
|
- name: offset
|
|
|
|
in: query
|
|
|
|
description: Pagination offset
|
|
|
|
required: false
|
|
|
|
schema:
|
|
|
|
type: integer
|
|
|
|
- name: limit
|
|
|
|
in: query
|
|
|
|
description: Pagination limit
|
|
|
|
required: false
|
|
|
|
schema:
|
|
|
|
type: integer
|
2020-11-25 17:48:26 +01:00
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
description: List data
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/List'
|
|
|
|
|
2020-11-26 17:34:24 +01:00
|
|
|
/api/items/{itemid}:
|
2020-11-25 17:48:26 +01:00
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- backend
|
2020-11-26 05:50:58 +01:00
|
|
|
summary: Gets data of an item
|
|
|
|
operationId: getItem
|
2020-11-25 17:48:26 +01:00
|
|
|
parameters:
|
2020-11-26 05:50:58 +01:00
|
|
|
- name: itemid
|
2020-11-25 17:48:26 +01:00
|
|
|
in: path
|
2020-11-26 05:50:58 +01:00
|
|
|
description: ID of an item
|
2020-11-25 17:48:26 +01:00
|
|
|
required: true
|
|
|
|
schema:
|
2020-11-26 01:40:58 +01:00
|
|
|
type: string
|
|
|
|
format: uuid
|
2020-11-25 17:48:26 +01:00
|
|
|
responses:
|
|
|
|
200:
|
2020-11-26 05:50:58 +01:00
|
|
|
description: Item data
|
2020-11-25 17:48:26 +01:00
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
2020-11-26 05:50:58 +01:00
|
|
|
$ref: '#/components/schemas/Item'
|
2020-11-25 17:48:26 +01:00
|
|
|
|
|
|
|
components:
|
|
|
|
schemas:
|
2020-11-26 02:31:14 +01:00
|
|
|
MainList:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
ids:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
id:
|
|
|
|
type: string
|
|
|
|
format: uuid
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
element_count:
|
|
|
|
type: integer
|
2020-11-26 21:36:09 +01:00
|
|
|
type:
|
|
|
|
type: string
|
2020-11-26 02:31:14 +01:00
|
|
|
count:
|
|
|
|
type: integer
|
2020-11-25 17:48:26 +01:00
|
|
|
List:
|
|
|
|
required:
|
|
|
|
- id
|
2020-11-26 03:50:47 +01:00
|
|
|
- name
|
2020-11-26 02:31:14 +01:00
|
|
|
- element_count
|
2020-11-26 05:47:27 +01:00
|
|
|
- itemlist
|
|
|
|
- type
|
2020-11-25 17:48:26 +01:00
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
id:
|
2020-11-26 01:40:58 +01:00
|
|
|
type: string
|
|
|
|
format: uuid
|
2020-11-26 03:50:47 +01:00
|
|
|
name:
|
|
|
|
type: string
|
2020-11-26 02:31:14 +01:00
|
|
|
element_count:
|
|
|
|
type: integer
|
2020-11-26 05:47:27 +01:00
|
|
|
type:
|
|
|
|
type: string
|
|
|
|
itemlist:
|
2020-11-25 17:48:26 +01:00
|
|
|
type: array
|
|
|
|
items:
|
2020-11-26 05:50:58 +01:00
|
|
|
$ref: '#/components/schemas/Item'
|
|
|
|
Item:
|
2020-11-25 17:48:26 +01:00
|
|
|
required:
|
|
|
|
- id
|
|
|
|
- title
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
id:
|
2020-11-26 01:40:58 +01:00
|
|
|
type: string
|
|
|
|
format: uuid
|
2020-11-25 17:48:26 +01:00
|
|
|
title:
|
|
|
|
type: string
|
|
|
|
artist:
|
|
|
|
type: string
|
|
|
|
album:
|
|
|
|
type: string
|
|
|
|
spotify_id:
|
|
|
|
type: string
|
2020-11-25 18:17:55 +01:00
|
|
|
cover_url:
|
|
|
|
type: string
|
|
|
|
format: url
|
2020-11-26 18:02:55 +01:00
|
|
|
cover_url_small:
|
|
|
|
type: string
|
|
|
|
format: url
|
2020-11-25 17:48:26 +01:00
|
|
|
LoginToken:
|
|
|
|
required:
|
2020-11-26 01:27:24 +01:00
|
|
|
- token
|
2020-11-25 17:48:26 +01:00
|
|
|
type: object
|
|
|
|
properties:
|
2020-11-26 01:27:24 +01:00
|
|
|
token:
|
2020-11-25 17:48:26 +01:00
|
|
|
type: string
|
|
|
|
User:
|
|
|
|
required:
|
|
|
|
- name
|
|
|
|
- password
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
password:
|
|
|
|
type: string
|
2020-11-25 18:49:37 +01:00
|
|
|
UserName:
|
|
|
|
required:
|
|
|
|
- name
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
name:
|
|
|
|
type: string
|
2020-11-25 17:48:26 +01:00
|
|
|
ApiResponse:
|
|
|
|
required:
|
|
|
|
- message
|
|
|
|
- status
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
status:
|
|
|
|
type: string
|
|
|
|
message:
|
|
|
|
type: string
|