{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Accompli configuration schema",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "$extend": {
            "type": "string"
        },
        "hosts": {
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "stage": {
                        "type": "string",
                        "pattern": "^test|acceptance|production$"
                    },
                    "connectionType": {
                        "type": "string"
                    },
                    "hostname": {
                        "type": "string"
                    },
                    "path": {
                        "type": "string"
                    },
                    "connectionOptions": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {}
                    }
                },
                "required": [
                    "stage",
                    "connectionType",
                    "hostname",
                    "path"
                ]
            }
        },
        "events": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "subscribers": {
                    "type": "array",
                    "items": {
                        "type": [
                            "string",
                            "object"
                        ],
                        "additionalProperties": true,
                        "properties": {
                            "class": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "class"
                        ]
                    }
                },
                "listeners": {
                    "type": "object",
                    "additionalProperties": true
                }
            }
        },
        "deployment": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "strategy": {
                    "type": "string"
                },
                "connection": {
                    "type": "object",
                    "additionalProperties": true
                }
            },
            "required": [
                "strategy"
            ]
        }
    },
    "required": [
        "hosts",
        "events",
        "deployment"
    ]
}