{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Admin Query",
    "description": "Description of an administrator SQL query.",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "description"
    ],
    "properties": {
        "description": {
            "description": "Brief one-line description of the query.",
            "type": "string"
        },
        "resultFormats": {
            "description": "Custom formats for result columns.",
            "type": "object",
            "additionalProperties": {
                "type": "string",
                "enum": [
                    "pre"
                ]
            }
        },
        "params": {
            "description": "Parameters for the query.",
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "name",
                    "description"
                ],
                "properties": {
                    "name": {
                        "description": "Name of the parameter. Must match a $name in the SQL.",
                        "type": "string"
                    },
                    "description": {
                        "description": "Brief one-line description of the parameter.",
                        "type": "string"
                    },
                    "default": {
                        "description": "Default value.",
                        "type": "string"
                    }
                }
            }
        }
    }
}