docdef/misc/sd.schema.json
2026-02-23 20:16:38 +01:00

234 lines
3.7 KiB
JSON

{
"definitions": {
"doc_object": {
"anyOf": [
{
"type": "object",
"reqired": [
"kind",
"data"
],
"properties": {
"kind": {
"type": "string",
"enum": ["code"]
},
"data": {
"type": "object",
"reqired": [
"content"
],
"properties": {
"content": {
"type": "string"
}
}
}
}
},
{
"type": "object",
"reqired": [
"kind",
"data"
],
"properties": {
"kind": {
"type": "string",
"enum": ["text"]
},
"data": {
"type": "object",
"reqired": [
"content"
],
"properties": {
"content": {
"type": "string"
}
}
}
}
},
{
"type": "object",
"reqired": [
"kind",
"data"
],
"properties": {
"kind": {
"type": "string",
"enum": ["link"]
},
"data": {
"type": "object",
"reqired": [
"target",
"label"
],
"properties": {
"target": {
"type": "string"
},
"label": {
"nullable": true,
"type": "string"
}
}
}
}
},
{
"type": "object",
"reqired": [
"kind",
"data"
],
"properties": {
"kind": {
"type": "string",
"enum": ["section"]
},
"data": {
"type": "object",
"required": [
"title",
"content"
],
"properties": {
"title": {
"type": "string"
},
"content": {
"$ref": "#/definitions/doc_object"
}
}
}
}
},
{
"type": "object",
"reqired": [
"kind",
"data"
],
"properties": {
"kind": {
"type": "string",
"enum": ["group"]
},
"data": {
"type": "object",
"required": [
"members"
],
"properties": {
"members": {
"type": "array",
"items": {
"$ref": "#/definitions/doc_object"
}
}
}
}
}
},
{
"type": "object",
"reqired": [
"kind",
"data"
],
"properties": {
"kind": {
"type": "string",
"enum": ["list"]
},
"data": {
"type": "object",
"required": [
"items"
],
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/doc_object"
}
}
}
}
}
},
{
"type": "object",
"reqired": [
"kind",
"data"
],
"properties": {
"kind": {
"type": "string",
"enum": ["table"]
},
"data": {
"type": "object",
"required": [
"head",
"rows"
],
"properties": {
"head": {
"nullable": true,
"type": "array",
"items": {
"$ref": "#/definitions/doc_object"
}
},
"rows": {
"type": "array",
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/doc_object"
}
}
}
}
}
}
}
]
}
},
"type": "object",
"required": [
"definitions",
"content"
],
"properties": {
"definitions": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/doc_object"
}
},
"content": {
"type": "object",
"required": [
"title",
"main"
],
"properties": {
"title": {
"type": "string"
},
"main": {
"$ref": "#/definitions/doc_object"
}
}
}
}
}