{
    "$schema": "http://json-schema.org/draft-04/schema",
    "id": "http://danielzhu.tk/birthland/data",
    "title": "Stages",
    "type": "object",
    "additionalProperties": {
        "title": "Stage",
        "additionalProperties": false,
        "properties": {
            "start": {
                "$ref": "#/definitions/break"
            },
            "text": {
                "$ref": "#/definitions/text"
            },
            "end": {
                "$ref": "#/definitions/break"
            },
            "stage": {
                "type": "string"
            },
            "choices": {
                "type": "array",
                "items": {
                    "type": "object",
                    "required": [
                        "text",
                        "prompt"
                    ],
                    "additionalProperties": false,
                    "properties": {
                        "description": {
                            "$ref": "#/definitions/text"
                        },
                        "text": {
                            "type": "string"
                        },
                        "prompt": {
                            "$ref": "#/definitions/text"
                        },
                        "action": {
                            "type": "string"
                        },
                        "stage": {
                            "type": "string"
                        },
                        "condition": {
                            "type": "string"
                        }
                    }
                },
                "minItems": 1
            }
        }
    },
    "definitions": {
        "text": {
            "oneOf": [
                {
                    "type": "string"
                },
                {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "minItems": 1
                }
            ]
        },
        "break": {
            "enum": [
                "none",
                "paragraph",
                "page"
            ]
        }
    }
}