openapi: 3.0.0
info:
description: Описание методов REST API для сервиса
version: 0.0.1
title: api music content
servers:
- url: https://simapple.ru/api/v1
tags:
- name: main
description: Общие запросы
- name: compilation
description: Подборки
- name: catalog
description: Треки (Композиции)
- name: dictionary
description: Справочники
paths:
/main:
get:
tags:
- main
description: Проверка работы логики
responses:
"200":
description: ""
content:
"application/json":
schema:
$ref: "#/components/schemas/MainResponse"
/compilation/novelties:
get:
tags:
- compilation
description: ""
responses:
"200":
description: ""
content:
"*/*":
schema:
$ref: "#/components/schemas/MainResponseElementAlbum"
/compilation/preorder:
get:
tags:
- compilation
description: ""
responses:
"200":
description: ""
content:
"*/*":
schema:
$ref: "#/components/schemas/MainResponseElementAlbum"
/compilation/personal:
get:
tags:
- compilation
description: ""
responses:
"200":
description: ""
content:
"*/*":
schema:
$ref: "#/components/schemas/MainResponseElementAlbum"
/tracks/hits:
get:
tags:
- catalog
description: ""
responses:
"200":
description: ""
content:
"*/*":
schema:
$ref: "#/components/schemas/MainResponseElementAlbum"
/tracks/novelties:
get:
tags:
- catalog
description: ""
responses:
"200":
description: ""
content:
"*/*":
schema:
$ref: "#/components/schemas/MainResponseElementAlbum"
"/track/{track_id}":
parameters:
- name: track_id
required: true
in: path
schema:
type: integer
get:
tags:
- catalog
description: Получение полной информаци по треку
responses:
200:
description: ok
content:
"*/*":
schema:
$ref: "#/components/schemas/Track"
"/album/{album_id}":
parameters:
- name: album_id
required: true
in: path
schema:
type: integer
get:
tags:
- catalog
description: Получение полной информаци по альбому
responses:
200:
description: ok
content:
"*/*":
schema:
$ref: "#/components/schemas/Album"
"/artist/{artist_id}":
parameters:
- name: artist_id
required: true
in: path
schema:
type: integer
get:
tags:
- catalog
description: Получение полной информаци по артисту
responses:
200:
description: ok
content:
"*/*":
schema:
$ref: "#/components/schemas/Artist"
"/genre/{genre_id}":
get:
tags:
- dictionary
description: Получение полной информаци по жанру, по его идентификатору
parameters:
- name: genre_id
required: true
in: path
schema:
type: integer
responses:
"200":
description: Success
"404":
description: Not Found
/genres/top:
get:
tags:
- dictionary
description: Список популярных жанров
responses:
200:
description: Success
content:
"*/*":
schema:
type: array
items:
$ref: "#/components/schemas/Genre"
/library/artists:
get:
tags:
- dictionary
description: Дать описание
responses:
200:
description: Дать описание
content:
"application/json":
schema:
type: array
items:
$ref: '#/components/schemas/Genre'
/library/albums:
get:
tags:
- dictionary
description: Дать описание
responses:
200:
description: Дать описание
content:
"application/json":
schema:
type: array
items:
$ref: '#/components/schemas/Genre'
/library/tracks:
get:
tags:
- dictionary
description: Дать описание
responses:
"200":
description: Дать описание
content:
"application/json":
schema:
type: array
items:
$ref: '#/components/schemas/Genre'
/library/playlists:
get:
tags:
- dictionary
description: Дать описание
responses:
"200":
description: Дать описание
content:
"application/json":
schema:
type: array
items:
$ref: '#/components/schemas/Genre'
/playlist:
post:
tags:
- user
description: Создание нового плейлиста
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PlaylistRequestNew'
responses:
200:
description: Created playlist
content:
application/json:
schema:
$ref: '#/components/schemas/Playlist'
"/playlist/{playlist_id}":
parameters:
- name: playlist_id
required: true
in: path
schema:
type: integer
get:
tags:
- user
description: Получение плейлиста
responses:
200:
description: Playlist
content:
application/json:
schema:
$ref: '#/components/schemas/Playlist'
patch:
tags:
- user
description: Обновление плейлиста
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PlaylistRequestUpdate'
responses:
200:
description: Updated playlist
content:
application/json:
schema:
$ref: '#/components/schemas/Playlist'
post:
tags:
- user
description: Добавление трека в плейлист
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PlaylistRequestAddTrack'
responses:
200:
description: Updated playlist
content:
application/json:
schema:
$ref: '#/components/schemas/Playlist'
delete:
tags:
- user
description: Удаление плейлиста
responses:
204:
description: "-"
"/playlist/{playlist_id}/track/{track_id}":
parameters:
- name: playlist_id
required: true
in: path
schema:
type: integer
- name: track_id
required: true
in: path
schema:
type: integer
delete:
tags:
- user
description: Удаление трека из плейлиста
responses:
204:
description: "-"
components:
schemas:
MainResponse:
type: object
properties:
data:
type: array
items:
oneOf:
- $ref: "#/components/schemas/MainResponseElementAlbum"
- $ref: "#/components/schemas/MainResponseElementTrack"
- $ref: "#/components/schemas/MainResponseElementGenre"
MainResponseElementAlbum:
type: object
properties:
id:
type: string
section_type:
type: string
show_more:
type: boolean
title:
type: string
items:
type: array
items:
$ref: "#/components/schemas/AlbumTiny"
MainResponseElementTrack:
type: object
properties:
id:
type: string
section_type:
type: string
show_more:
type: boolean
title:
type: string
items:
type: array
items:
$ref: "#/components/schemas/TrackShort"
MainResponseElementGenre:
type: object
properties:
id:
type: string
section_type:
type: string
show_more:
type: boolean
title:
type: string
items:
type: array
items:
$ref: "#/components/schemas/Genre"
ArtistTiny:
type: object
properties:
id:
type: integer
name:
type: string
picture:
$ref: "#/components/schemas/Picture"
Artist:
type: object
properties:
id:
type: integer
name:
type: string
picture:
$ref: "#/components/schemas/Picture"
albums:
type: array
items:
$ref: "#/components/schemas/AlbumTiny"
tracks:
type: object
properties:
top:
type: array
items:
$ref: "#/components/schemas/TrackTiny"
hits:
type: array
items:
$ref: "#/components/schemas/TrackTiny"
AlbumTiny:
type: object
description: Используется для отображения в списке альбомов артиста
properties:
id:
type: integer
title:
type: string
release_date:
type: string
picture:
$ref: "#/components/schemas/Picture"
artists:
type: array
items:
$ref: "#/components/schemas/ArtistTiny"
Album:
type: object
properties:
id:
type: integer
available:
type: boolean
title:
type: string
duration:
type: integer
release_date:
type: string
genres:
type: array
items:
$ref: "#/components/schemas/Genre"
label:
$ref: "#/components/schemas/Label"
picture:
$ref: "#/components/schemas/Picture"
artists:
type: array
items:
$ref: "#/components/schemas/ArtistTiny"
tracks:
type: array
items:
$ref: "#/components/schemas/TrackTiny"
TrackTiny:
type: object
properties:
id:
type: integer
available:
type: boolean
title:
type: string
duration:
type: integer
rank:
type: number
release_date:
type: string
artists:
type: array
items:
$ref: "#/components/schemas/ArtistTiny"
TrackShort:
type: object
properties:
id:
type: integer
available:
type: boolean
title:
type: string
duration:
type: integer
rank:
type: number
release_date:
type: string
artists:
type: array
items:
$ref: "#/components/schemas/ArtistTiny"
album:
$ref: "#/components/schemas/AlbumTiny"
Track:
type: object
properties:
id:
type: integer
available:
type: boolean
title:
type: string
duration:
type: integer
rank:
type: number
release_date:
type: string
artists:
type: array
items:
$ref: "#/components/schemas/ArtistTiny"
album:
$ref: "#/components/schemas/AlbumTiny"
Label:
type: object
properties:
id:
type: integer
title:
type: string
Genre:
type: object
properties:
id:
type: integer
title:
type: string
picture:
$ref: "#/components/schemas/Picture"
Picture:
type: object
properties:
hash:
type: string
background:
type: object
properties:
color:
type: string
gradient:
type: object
properties:
todo:
type: "string"
Playlist:
type: object
properties:
id:
type: integer
title:
type: string
description:
type: string
duration:
type: integer
track_count:
type: integer
tracks:
type: array
items:
$ref: "#/components/schemas/TrackShort"
PlaylistRequestNew:
type: object
properties:
title:
type: string
description:
type: string
PlaylistRequestUpdate:
type: object
properties:
id:
type: integer
title:
type: string
description:
type: string
tracks:
type: array
items:
type: integer
PlaylistRequestAddTrack:
type: object
properties:
id:
type: integer
tracks:
type: array
items:
type: integer