-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-spec.yaml
More file actions
241 lines (241 loc) · 5.89 KB
/
Copy pathapi-spec.yaml
File metadata and controls
241 lines (241 loc) · 5.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
openapi: 3.0.3
info:
title: eXstream Playlist API
version: 0.1.0
servers:
- url: http://localhost:5001
- url: http://localhost:8080
security:
- bearerAuth: []
paths:
/playlists:
get:
summary: List playlists visible to the current identity.
responses:
"200":
description: Playlists
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Playlist"
"403":
description: Missing identity headers
post:
summary: Create a playlist owned by the current identity.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/PlaylistWrite"
responses:
"200":
description: Created playlist
content:
application/json:
schema:
$ref: "#/components/schemas/Playlist"
/playlists/{id}:
get:
summary: Fetch a playlist.
parameters:
- $ref: "#/components/parameters/PlaylistId"
responses:
"200":
description: Playlist
content:
application/json:
schema:
$ref: "#/components/schemas/Playlist"
"404":
description: Playlist not found
delete:
summary: Delete a playlist.
parameters:
- $ref: "#/components/parameters/PlaylistId"
responses:
"200":
description: Deleted
"404":
description: Playlist not found
/playlists/{id}/tracks:
post:
summary: Add a track to a playlist.
parameters:
- $ref: "#/components/parameters/PlaylistId"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/TrackWrite"
responses:
"200":
description: Updated playlist
content:
application/json:
schema:
$ref: "#/components/schemas/Playlist"
/playlists/{id}/tracks/{trackId}:
put:
summary: Update a track in a playlist.
parameters:
- $ref: "#/components/parameters/PlaylistId"
- $ref: "#/components/parameters/TrackId"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/TrackWrite"
responses:
"200":
description: Updated playlist
content:
application/json:
schema:
$ref: "#/components/schemas/Playlist"
"404":
description: Track not found
delete:
summary: Delete a track from a playlist.
parameters:
- $ref: "#/components/parameters/PlaylistId"
- $ref: "#/components/parameters/TrackId"
responses:
"200":
description: Updated playlist
content:
application/json:
schema:
$ref: "#/components/schemas/Playlist"
"404":
description: Track not found
/playlists/{id}/tracks/{trackId}/move:
post:
summary: Atomically move a track to another playlist.
parameters:
- $ref: "#/components/parameters/PlaylistId"
- $ref: "#/components/parameters/TrackId"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
targetPlaylistId:
type: string
responses:
"200":
description: Target playlist with the moved track
content:
application/json:
schema:
$ref: "#/components/schemas/Playlist"
"403":
description: Source or target playlist access denied
"404":
description: Playlist, track, or target not found
/playlist/search:
get:
summary: Search playlists.
parameters:
- name: q
in: query
schema:
type: string
responses:
"200":
description: Matching playlists
/music/search:
get:
summary: Search tracks across visible playlists.
parameters:
- name: q
in: query
schema:
type: string
responses:
"200":
description: Matching tracks
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Track"
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
parameters:
PlaylistId:
name: id
in: path
required: true
schema:
type: string
TrackId:
name: trackId
in: path
required: true
schema:
type: string
schemas:
PlaylistWrite:
type: object
required: [name]
properties:
name:
type: string
description:
type: string
TrackWrite:
type: object
required: [title, url]
properties:
title:
type: string
artist:
type: string
url:
type: string
coverUrl:
type: string
Playlist:
type: object
properties:
id:
type: string
name:
type: string
description:
type: string
owner:
type: string
tracks:
type: array
items:
$ref: "#/components/schemas/Track"
Track:
type: object
properties:
id:
type: string
playlistId:
type: string
title:
type: string
artist:
type: string
url:
type: string
addedBy:
type: string
coverUrl:
type: string