{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Индекс каталога программ", "description": "Схема index.yaml для категории или программы.", "oneOf": [ { "$ref": "#/$defs/category" }, { "$ref": "#/$defs/program" } ], "$defs": { "name": { "type": "string", "minLength": 1, "maxLength": 240 }, "description": { "type": "string", "minLength": 1, "maxLength": 4000, "contentMediaType": "text/markdown" }, "summary": { "type": "string", "minLength": 1, "maxLength": 120 }, "url": { "type": "string", "format": "uri", "pattern": "^https?://" }, "filePath": { "type": "string", "pattern": "^(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)files/.+$" }, "screenshotPath": { "type": "string", "pattern": "^(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)img/.+\\.(?:png|jpe?g|webp|gif)$" }, "file": { "title": "Файл программы", "type": "object", "additionalProperties": false, "required": [ "path" ], "properties": { "path": { "$ref": "#/$defs/filePath" }, "description": { "$ref": "#/$defs/description" }, "platform": { "type": "string", "enum": [ "win32", "win64", "dos", "java", "j2me" ] }, "size": { "type": "integer", "minimum": 0 }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" } } }, "version": { "title": "Версия программы", "type": "object", "additionalProperties": false, "required": [ "version", "files" ], "properties": { "version": { "type": "string", "minLength": 1, "maxLength": 80, "pattern": "^[^/\\\\]+$" }, "status": { "type": "string", "enum": [ "current", "archived" ] }, "released": { "type": "string", "format": "date" }, "description": { "$ref": "#/$defs/description" }, "files": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/file" } } } }, "category": { "title": "Категория", "type": "object", "additionalProperties": false, "required": [ "format", "type", "name", "description" ], "properties": { "format": { "const": 1 }, "type": { "const": "category" }, "name": { "$ref": "#/$defs/name" }, "order": { "type": "integer" }, "description": { "$ref": "#/$defs/description" } } }, "program": { "title": "Программа", "type": "object", "additionalProperties": false, "required": [ "format", "type", "name", "summary", "description", "screenshots", "versions" ], "properties": { "format": { "const": 1 }, "type": { "const": "program" }, "name": { "$ref": "#/$defs/name" }, "summary": { "$ref": "#/$defs/summary" }, "description": { "$ref": "#/$defs/description" }, "homepage": { "$ref": "#/$defs/url" }, "source": { "$ref": "#/$defs/url" }, "author": { "$ref": "#/$defs/name" }, "screenshots": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/screenshotPath" } }, "versions": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/version" } }, "additional_files": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/file" } } } } } }