diff --git a/list.schema.json b/list.schema.json new file mode 100644 index 0000000..4532483 --- /dev/null +++ b/list.schema.json @@ -0,0 +1,85 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://c0ntroller.de/content/list.schema.json", + "title": "Content List", + "description": "A list of projects and diaries for my homepage.", + "type": "array", + "items": { + "anyOf": [ + { "$ref": "#/$defs/project" }, + { "$ref": "#/$defs/diary" } + ] + }, + "$defs": { + "content": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["project", "diary"] + }, + "name": { + "type": "string", + "pattern": "^[a-z0-9-_]+$" + }, + "short_desc": { + "type": "string", + "maxLength": 100 + }, + "desc": { + "type": "array", + "items": { + "type": "string" + } + }, + "more": { + "type": "string", + "format": "uri" + }, + "repo": { + "type": "string", + "format": "uri" + } + }, + "required": ["type", "name", "short_desc", "desc"] + }, + "project": { + "type": "object", + "allOf": [ + { "$ref": "#/$defs/content" } + ], + "properties": { + "type": { + "const": "project" + } + } + }, + "diary": { + "type": "object", + "allOf": [ + { "$ref": "#/$defs/content" } + ], + "properties": { + "type": { + "const": "diary" + }, + "entries": { + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "filename": { + "type": "string" + } + }, + "required": ["title", "filename"] + } + } + }, + "required": ["entries"] + } + } + } \ No newline at end of file