From c90495eb1c1884081ff21ae984f765011dc5c7ac Mon Sep 17 00:00:00 2001 From: profitroll Date: Thu, 5 Jan 2023 10:49:22 +0100 Subject: [PATCH] Added spoiler's validation rule --- validation/spoilers.json | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 validation/spoilers.json diff --git a/validation/spoilers.json b/validation/spoilers.json new file mode 100644 index 0000000..1837cbb --- /dev/null +++ b/validation/spoilers.json @@ -0,0 +1,43 @@ +{ + "$jsonSchema": { + "required": [ + "user", + "completed", + "description", + "photo", + "video", + "animation", + "text" + ], + "properties": { + "user": { + "bsonType": ["int", "long"], + "description": "Telegram ID of user" + }, + "completed": { + "bsonType": "bool", + "description": "Whether spoiler is a completed one" + }, + "description": { + "bsonType": ["string", "null"], + "description": "Spoiler's description" + }, + "photo": { + "bsonType": ["string", "null"], + "description": "Spoilered photo" + }, + "video": { + "bsonType": ["string", "null"], + "description": "Spoilered video" + }, + "animation": { + "bsonType": ["string", "null"], + "description": "Spoilered animation/GIF" + }, + "text": { + "bsonType": ["string", "null"], + "description": "Spoilered text" + } + } + } +} \ No newline at end of file