frontpage-content/list.schema.json

89 lines
2.6 KiB
JSON
Raw Normal View History

2022-06-23 16:05:41 +02:00
{
"$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"
2022-10-01 14:05:26 +02:00
},
"title": {
"type": "string",
"maxLength": 50
2022-06-23 16:05:41 +02:00
}
},
2022-10-01 14:05:26 +02:00
"required": ["type", "name", "short_desc", "desc", "title"]
2022-06-23 16:05:41 +02:00
},
"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"]
}
}
}