From 5f09ad23eebda8dfbaa727a4fd5266185f16bce9 Mon Sep 17 00:00:00 2001 From: ReaperOfVeriod Date: Sun, 25 Oct 2026 04:45:55 +0100 Subject: [PATCH] feat: add stream info contracts --- contracts/v1/stream-info-request.json | 15 +++++++++++++++ contracts/v1/stream-info-response.json | 18 ++++++++++++++++++ fixtures/v1/stream-info.response.json | 10 ++++++++++ 3 files changed, 43 insertions(+) create mode 100644 contracts/v1/stream-info-request.json create mode 100644 contracts/v1/stream-info-response.json create mode 100644 fixtures/v1/stream-info.response.json diff --git a/contracts/v1/stream-info-request.json b/contracts/v1/stream-info-request.json new file mode 100644 index 0000000..ea2bdf5 --- /dev/null +++ b/contracts/v1/stream-info-request.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://trixie.reaperofveriod.nl/contracts/v1/stream-info-request.json", + "title": "Twitch stream information update", + "type": "object", + "additionalProperties": false, + "minProperties": 1, + "properties": { + "title": { "type": "string", "maxLength": 140 }, + "game_id": { "type": "string", "maxLength": 64 }, + "language": { "type": "string", "maxLength": 10 }, + "tags": { "type": "array", "maxItems": 10, "items": { "type": "string", "maxLength": 25 } }, + "content_classification_labels": { "type": "array", "maxItems": 10, "items": { "type": "string", "maxLength": 64 } } + } +} diff --git a/contracts/v1/stream-info-response.json b/contracts/v1/stream-info-response.json new file mode 100644 index 0000000..d519c27 --- /dev/null +++ b/contracts/v1/stream-info-response.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://trixie.reaperofveriod.nl/contracts/v1/stream-info-response.json", + "title": "Twitch stream information", + "type": "object", + "additionalProperties": false, + "required": ["broadcaster_id", "broadcaster_name", "game_id", "game_name", "title", "language", "tags", "content_classification_labels"], + "properties": { + "broadcaster_id": { "type": "string", "minLength": 1 }, + "broadcaster_name": { "type": "string", "minLength": 1 }, + "game_id": { "type": "string" }, + "game_name": { "type": "string" }, + "title": { "type": "string" }, + "language": { "type": "string" }, + "tags": { "type": "array", "items": { "type": "string" } }, + "content_classification_labels": { "type": "array", "items": { "type": "string" } } + } +} diff --git a/fixtures/v1/stream-info.response.json b/fixtures/v1/stream-info.response.json new file mode 100644 index 0000000..1992d55 --- /dev/null +++ b/fixtures/v1/stream-info.response.json @@ -0,0 +1,10 @@ +{ + "broadcaster_id": "synthetic-broadcaster-id", + "broadcaster_name": "SyntheticStreamer", + "game_id": "123", + "game_name": "Synthetic Game", + "title": "A synthetic stream", + "language": "en", + "tags": ["Synthetic"], + "content_classification_labels": [] +}