This commit is contained in:
2015-10-17 04:30:26 +02:00
parent 7f3395ce7e
commit 8894fe5880
9 changed files with 520 additions and 2 deletions
@@ -0,0 +1,179 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Sitemap Template Schema",
"description": "",
"version": "1.0.0",
"type": "object",
"properties": {
"type": {
"type": "string",
"pattern": "sitemap/sitemap_template"
},
"title": {
"type": "string",
"description": ""
},
"rootpage": {
"$ref": "#/definitions/page"
}
},
"additionalProperties": false,
"required": ["title", "rootpage"],
"definitions": {
"page": {
"type": "object",
"properties": {
"type": {
"type": "string",
"pattern": "sitemap/sitemap_template#/definitions/page"
},
"title": {
"type": "string"
},
"elements": {
"type": "array",
"items": {
"$ref": "#/definitions/element"
}
}
},
"additionalProperties": false,
"required": ["title", "elements"]
},
"element": {
"anyOf": [
{ "$ref": "#/definitions/composite_element" },
{ "$ref": "#/definitions/atomic_element" }
]
},
"composite_element": {
"anyOf": [
{ "$ref": "#/definitions/frame_element" }
]
},
"atomic_element": {
"anyOf": [
{ "$ref": "#/definitions/text_element" },
{ "$ref": "#/definitions/slider_element" },
{ "$ref": "#/definitions/switch_element" }
]
},
"composite_element_base": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"icon": {
"type": "string"
},
"elements": {
"type": "array",
"items": {
"$ref": "#/definitions/element"
}
}
},
"required": ["elements"]
},
"frame_element": {
"allOf": [
{ "$ref": "#/definitions/composite_element_base" },
{
"properties": {
"type": {
"type": "string",
"pattern": "sitemap/sitemap_template#/definitions/frame_element"
}
}
}
],
"required": ["type"]
},
"atomic_element_base": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"format": {
"type": "string"
},
"device": {
"$ref": "#/definitions/device"
},
"icon": {
"type": "string"
}
}
},
"text_element": {
"allOf": [
{ "$ref": "#/definitions/atomic_element_base" },
{
"properties": {
"type": {
"type": "string",
"pattern": "sitemap/sitemap_template#/definitions/text_element"
}
}
}
],
"required": ["type"]
},
"slider_element": {
"allOf": [
{ "$ref": "#/definitions/atomic_element_base" },
{
"properties": {
"type": {
"type": "string",
"pattern": "sitemap/sitemap_template#/definitions/slider_element"
},
"min": {
"type": "number"
},
"max": {
"type": "number"
},
"step": {
"type": "number"
}
}
}
],
"required": ["type"]
},
"switch_element": {
"allOf": [
{ "$ref": "#/definitions/atomic_element_base" },
{
"properties": {
"type": {
"type": "string",
"pattern": "sitemap/sitemap_template#/definitions/switch_element"
}
}
}
],
"required": ["type"]
},
"device": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"pointer": {
"type": "string"
}
},
"required": ["id"]
}
}
}