mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 05:11:34 +00:00
This commit introduces a new blog feature by implementing a JSON schema for blog posts and providing five example content files. Key changes: - Created a new directory structure for schemas and content (`schemas/`, `content/blog/`). - Implemented a JSON schema for blog posts, split into `blog.json` and `_defs.json` for reusability. - Added five example blog post files with full, realistic content. - Included a Python script (`validate.py`) to validate the example content against the schema.
42 lines
1.2 KiB
JSON
42 lines
1.2 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://example.com/schemas/_defs.json",
|
|
"title": "Common Definitions",
|
|
"$defs": {
|
|
"imageAsset": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["url", "alt"],
|
|
"properties": {
|
|
"url": { "type": "string", "format": "uri" },
|
|
"alt": { "type": "string" },
|
|
"width": { "type": "integer", "minimum": 1 },
|
|
"height": { "type": "integer", "minimum": 1 },
|
|
"mime": { "type": "string" }
|
|
}
|
|
},
|
|
"attachment": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["label", "url"],
|
|
"properties": {
|
|
"label": { "type": "string" },
|
|
"url": { "type": "string", "format": "uri" },
|
|
"mime": { "type": "string" }
|
|
}
|
|
},
|
|
"source": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["title", "url"],
|
|
"properties": {
|
|
"id": { "type": "string" },
|
|
"title": { "type": "string" },
|
|
"publisher": { "type": "string" },
|
|
"url": { "type": "string", "format": "uri" },
|
|
"date_accessed": { "type": "string", "format": "date" }
|
|
}
|
|
}
|
|
}
|
|
}
|