{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Instrument config",
    "type": "object",
    "properties": {
        "instruments": {
            "type": "object",
            "patternProperties": {
                "^.*$": {
                    "type": "object",
                    "properties": {
                        "destination": {
                            "type": "string"
                        },
                        "mode": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "destination",
                        "mode"
                    ]
                }
            }
        },
        "modes": {
            "type": "object",
            "patternProperties": {
                "^mode": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "begin": {
                                "type": "string"
                            },
                            "end": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "begin",
                            "end"
                        ]
                    }
                }
            }
        }
    },
    "required": [
        "instruments",
        "modes"
    ]
}