-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathopenapi.yaml
More file actions
77 lines (77 loc) · 2.57 KB
/
Copy pathopenapi.yaml
File metadata and controls
77 lines (77 loc) · 2.57 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
openapi: 3.1.0
info:
title: radio-dj API
version: 1.0.0
description: Personal 24/7 AI-DJ radio station. HTTP API for now-playing, requests, and liveness; audio is a separate Icecast stream.
servers:
- url: http://localhost:7710
description: local status API
paths:
/now-playing:
get:
summary: Current + next track, request queue, on-air status
responses:
'200':
description: now-playing payload
content:
application/json:
schema: { $ref: '#/components/schemas/NowPlaying' }
/request:
post:
summary: Submit a free-text song request
requestBody:
required: true
content:
application/json:
schema: { type: object, required: [text], properties: { text: { type: string } } }
responses:
'200':
description: request queued
content:
application/json:
schema: { $ref: '#/components/schemas/Request' }
/control:
post:
summary: Skip or replay the current track on the live broadcast
description: Kills the in-flight music decoder (listeners stay connected); the loop advances to the next or previous track. Shared broadcast — affects all listeners.
requestBody:
required: true
content:
application/json:
schema: { type: object, required: [action], properties: { action: { type: string, enum: [previous, next] } } }
responses:
'202':
description: accepted — decoder killed, loop advances
'409':
description: no track playing (between songs)
/health:
get:
summary: Liveness probe
responses:
'200':
description: on-air
content:
application/json:
schema: { type: object, properties: { status: { type: string } } }
components:
schemas:
Track:
type: object
properties:
title: { type: string }
artist: { type: string }
album: { type: string }
Request:
type: object
properties:
text: { type: string }
askedAt: { type: string, format: date-time }
status: { type: string, enum: [queued, matched, not-found] }
NowPlaying:
type: object
properties:
current: { $ref: '#/components/schemas/Track' }
next: { allOf: [{ $ref: '#/components/schemas/Track' }], nullable: true }
requests: { type: array, items: { $ref: '#/components/schemas/Request' } }
playing: { type: boolean }
startedAt: { type: string, format: date-time }