From ff52e989a2454b51f3a449a344c3eb3d5b03c1f2 Mon Sep 17 00:00:00 2001 From: Stefan Kratochwil Date: Tue, 4 Mar 2025 19:21:01 +0100 Subject: [PATCH] Forumlated potentially useful json schema. Note that this is based on an earlier state of the project, and the terms used in this schema may differ from the current state of the project. --- software/src/tonberry.schema.json | 53 +++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 software/src/tonberry.schema.json 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"] + } + } +}