Files
homeos_ws/src/hos_cosgi_sitemap/schema/sitemap/sitemap_template.json
T
2016-03-18 01:52:20 +01:00

217 lines
3.9 KiB
JSON

{
"$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": ""
},
"default": {
"type": "boolean",
"description": ""
},
"pages": {
"type": "object",
"patternProperties": {
"[A-Za-z0-9_-]+": {
"$ref": "#/definitions/page"
}
}
},
"rootpage": {
"type": "string"
}
},
"additionalProperties": false,
"required": ["title", "pages", "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" },
{ "$ref": "#/definitions/colorpicker_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"
},
"linkedPage": {
"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"]
},
"colorpicker_element": {
"allOf": [
{ "$ref": "#/definitions/atomic_element_base" },
{
"properties": {
"type": {
"type": "string",
"pattern": "sitemap/sitemap_template#/definitions/colorpicker_element"
}
}
}
],
"required": ["type"]
},
"device": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"pointer": {
"anyOf": [
{ "type": "string" },
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"required": ["id"]
}
}
}