{
    "$schema": "http://json-schema.org/draft-06/schema#",
    "title": "Kangrat",
    "description": "A schema for Kangrat",
    "type": "object",
    "properties": {
        "siteName": {
            "type": "string",
            "default": "My Kangrat Site",
            "description": "The name of the site"
        },
        "author": {
            "type": "string",
            "default": "somebody",
            "description": "The author of the site"
        },
        "basePage": {
            "type": "string",
            "default": "./basepage.html",
            "description": "The base page to build the templates off of"
        },
        "pages": {
            "type": "object",
            "additionalProperties": {
                "$ref": "#/definitions/page"
            },
            "description": "A map where the keys is the page name, the value is the schema and the template"
        },
        "elements": {
            "type": "object",
            "description": "A map where the keys are the element tag, and the value is the data about how to get the element",
            "additionalProperties": {
                "$ref": "#/definitions/bowerElement"
            }
        }
    },
    "additionalProperties": true,
    "required": [
        "siteName",
        "author",
        "basePage",
        "pages",
        "elements"
    ],
    "definitions": {
        "page": {
            "type": "object",
            "properties": {
                "schema": {
                    "type": "object",
                    "description": "A declaration of schema fields as the keys, the type of the field as a value",
                    "additionalProperties": {
                        "type": "string",
                        "enum": [
                            "string",
                            "number",
                            "object",
                            "array",
                            "boolean"
                        ]
                    }
                },
                "template": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/templateElement"
                    },
                    "description": "an array of elements and their bindings to a schema field"
                }
            },
            "additionalProperties": false
        },
        "templateElement": {
            "type": "object",
            "properties": {
                "elementTag": {
                    "type": "string"
                },
                "propertyBindings": {
                    "type": "object",
                    "description": "A declaration of bindings for this template, keys are the schema field and values are the element property"
                }
            },
            "required": [
                "elementTag"
            ]
        },
        "bowerElement": {
            "type": "object",
            "properties": {
                "bowerPackage": {
                    "type": "string",
                    "description": "The package to install with bower for this element"
                },
                "elementPath": {
                    "type": "string",
                    "description": "The path to the .html file to include (with root set to bower_components, no leading dotslash)"
                }
            },
            "additionalProperties": false
        }
    }
}