{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "DanceMove": {
            "oneOf": [
                {
                    "type": "string",
                    "description": "text of the dance element"
                },
                {
                    "type": "object",
                    "title": "one dance element",
                    "properties": {
                        "move": {
                            "type": "string",
                            "description": "text of dance element"
                        },
                        "duration": {
                            "type": "number",
                            "description": "length of element; units may be specified"
                        }
                    },
                    "required": [
                        "element"
                    ]
                }
            ]
        },
        "DanceSection": {
            "type": "object",
            "title": "a section of dance elements",
            "properties": {
                "label": {
                    "type": "string",
                    "description": "label for dance section, e.g. A, A1, B2. Can also be a separator"
                },
                "elements": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/DanceMove"
                    },
                    "description": "dance moves"
                }
            },
            "required": [
                "label"
            ]
        },
        "DanceTune": {
            "type": "object",
            "title": "dance tune information",
            "properties": {
                "title": {
                    "type": "string",
                    "desciption": "title of the dance tune"
                },
                "author": {
                    "type": "string",
                    "desciption": "author of the dance tune, if known"
                },
                "key": {
                    "type": "string",
                    "desciption": "key of the dance tune"
                },
                "meter": {
                    "type": "string",
                    "desciption": "meter of the dance tune"
                },
                "source": {
                    "type": "string",
                    "desciption": "source of the dance tune, e.g. tune book or web URL"
                }
            }
        }
    },
    "type": "object",
    "title": "dance schema",
    "description": "JSON schema for a structured dance",
    "properties": {
        "title": {
            "type": "string",
            "description": "The title of the dance"
        },
        "author": {
            "type": "string",
            "description": "Who wrote the dance, if known."
        },
        "genre": {
            "type": "string",
            "description": "The dance genre, such as 'Contra Dance', or 'English Country Dance'."
        },
        "formation": {
            "type": "string",
            "description": "Dance formation, such as 'Longways Duple Minor', etc."
        },
        "source": {
            "type": "string",
            "description": "source for the dance, e.g. name of publication, web URL, unknown"
        },
        "date": {
            "type": "string",
            "description": "date of composition of the dance, if known; could be specific date or general time period"
        },
        "authors_notes": {
            "type": "string",
            "description": "notes about the dance written by the dance author"
        },
        "moves": {
            "type": "array",
            "title": "dance moves",
            "description": "array of dance moves",
            "items": {
                "$ref": "#/definitions/DanceSection"
            }
        },
        "tune": {
            "title": "dance tune",
            "description": "tune information for the dance",
            "type": "object",
            "$ref": "#/definitions/DanceTune"
        }
    },
    "required": [
        "title",
        "genre"
    ]
}