{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "title": "Event Search Schema",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "q": {
            "type": "string"
        },
        "id": {
            "type": "string"
        },
        "like": {
            "type": "string"
        },
        "label": {
            "type": "array"
        },
        "label.op": {
            "items": {
                "enum": [
                    "all",
                    "any"
                ]
            },
            "type": "array"
        },
        "within": {
            "type": "string",
            "pattern": "(\\d+(mm|cm|m|km|in|yd|ft|mi|nmi))@([\\-\\+]?\\d+(\\.\\d+)?),([\\-\\+]?\\d+(\\.\\d+)?)"
        },
        "country": {
            "type": "array"
        },
        "state": {
            "items": {
                "enum": [
                    "active",
                    "deleted"
                ]
            },
            "type": "array"
        },
        "start.tz": {
            "type": "string"
        },
        "start.gt": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "start.gte": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "start.lt": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "start.lte": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "end.tz": {
            "type": "string"
        },
        "end.gt": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "end.gte": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "end.lt": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "end.lte": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "updated.tz": {
            "type": "string"
        },
        "updated.gt": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "updated.gte": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "updated.lt": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "updated.lte": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "active.tz": {
            "type": "string"
        },
        "active.gt": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "active.gte": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "active.lt": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "active.lte": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "start_around.origin": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "start_around.offset": {
            "type": "string",
            "pattern": "^([0-9]+)d$"
        },
        "start_around.scale": {
            "type": "string",
            "pattern": "^([0-9]+)d$"
        },
        "start_around.decay": {
            "type": "number"
        },
        "end_around.origin": {
            "type": "string",
            "pattern": "^([0-9]{4})-[0-9]{2}-[0-9]{2}$"
        },
        "end_around.offset": {
            "type": "string",
            "pattern": "^([0-9]+)d$"
        },
        "end_around.scale": {
            "type": "string",
            "pattern": "^([0-9]+)d$"
        },
        "end_around.decay": {
            "type": "number"
        },
        "location_around.origin": {
            "type": "string",
            "pattern": "^(-?\\d+(\\.\\d+)?),(-?\\d+(\\.\\d+)?)$"
        },
        "location_around.offset": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?(cm|m|km|in|ft|mi)$"
        },
        "location_around.scale": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?(cm|m|km|in|ft|mi)$"
        },
        "location_around.decay": {
            "type": "number"
        },
        "place.scope": {
            "type": "array"
        },
        "place.exact": {
            "type": "array"
        },
        "relevance": {
            "type": "array"
        },
        "limit": {
            "type": "integer",
            "minimum": 1
        },
        "top_events.limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
        },
        "offset": {
            "type": "integer",
            "minimum": 0
        },
        "rank_level": {
            "items": {
                "enum": [
                    1,
                    2,
                    3,
                    4,
                    5
                ]
            },
            "type": "array"
        },
        "local_rank_level": {
            "items": {
                "enum": [
                    1,
                    2,
                    3,
                    4,
                    5
                ]
            },
            "type": "array"
        },
        "aviation_rank_level": {
            "items": {
                "enum": [
                    1,
                    2,
                    3,
                    4,
                    5
                ]
            },
            "type": "array"
        },
        "sort": {
            "items": {
                "enum": [
                    "id",
                    "title",
                    "start",
                    "end",
                    "updated",
                    "rank",
                    "local_rank",
                    "aviation_rank",
                    "category",
                    "duration",
                    "country",
                    "labels",
                    "relevance",
                    "-id",
                    "-title",
                    "-start",
                    "-end",
                    "-updated",
                    "-rank",
                    "-local_rank",
                    "-aviation_rank",
                    "-category",
                    "-duration",
                    "-country",
                    "-labels",
                    "-relevance"
                ]
            },
            "type": "array"
        },
        "top_events.sort": {
            "items": {
                "enum": [
                    "id",
                    "title",
                    "start",
                    "end",
                    "rank",
                    "local_rank",
                    "aviation_rank",
                    "category",
                    "duration",
                    "country",
                    "labels",
                    "-id",
                    "-title",
                    "-start",
                    "-end",
                    "-rank",
                    "-local_rank",
                    "-aviation_rank",
                    "-category",
                    "-duration",
                    "-country",
                    "-labels"
                ]
            },
            "type": "array"
        },
        "category": {
            "type": "array"
        }
    },
    "required": []
}