diff --git a/software/src/tonberry.schema.json b/software/src/tonberry.schema.json new file mode 100644 index 0000000..ca5d77e --- /dev/null +++ b/software/src/tonberry.schema.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "PlaybackPosition": { + "type": "object", + "properties": { + "position_seconds": { "type": "number" }, + "device_uptime": { "type": "number" } + }, + "required": ["position_seconds"] + }, + "AudioFile": { + "type": "object", + "properties": { + "id": { "type": "string", "format": "uuid" }, + "filename": { "type": "string" }, + "size_bytes": { "type": "integer" }, + "duration_seconds": { "type": "number" }, + "last_played_uptime": { "type": "number" }, + "playback_position": { "$ref": "#/definitions/PlaybackPosition" } + }, + "required": ["id", "filename"] + }, + "Playlist": { + "type": "object", + "properties": { + "id": { "type": "string", "format": "uuid" }, + "name": { "type": "string" }, + "audio_files": { + "type": "array", + "items": { "$ref": "#/definitions/AudioFile" } + }, + "current_track_index": { "type": "integer", "minimum": 0 }, + "last_played_uptime": { "type": "number" }, + "playback_position": { "$ref": "#/definitions/PlaybackPosition" } + }, + "required": ["id", "name", "audio_files"] + }, + "NfcTag": { + "type": "object", + "properties": { + "uid": { "type": "string" }, + "name": { "type": "string" }, + "linked_type": { + "type": "string", + "enum": ["audio_file", "playlist"] + }, + "linked_id": { "type": "string", "format": "uuid" } + }, + "required": ["uid", "linked_type", "linked_id"] + } + } +}