{
    "$schema": "http://json-schema.org/schema#",
    "$id": "https://ris-live.ripe.net/schemas/v1/server.schema.json",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "type"
    ],
    "examples": [
        {
            "type": "pong",
            "data": null
        }
    ],
    "title": "RIS Live server message",
    "properties": {
        "type": {
            "type": "string",
            "description": "Server message type",
            "enum": [
                "ris_message",
                "ris_error",
                "ris_rrc_list",
                "ris_subscribe_ok",
                "pong"
            ]
        },
        "data": {
            "description": "Server message payload. The contents (if any) depend on the `type`."
        }
    },
    "allOf": [
        {
            "if": {"properties": {"type": {"const": "ris_message"}}},
            "then": {"properties": {"data": {"$ref": "ris_message.schema.json"}}}
        },
        {
            "if": {"properties": {"type": {"const": "ris_error"}}},
            "then": {"properties": {"data": {"$ref": "ris_error.schema.json"}}}
        },
        {
            "if": {"properties": {"type": {"const": "ris_rrc_list"}}},
            "then": {"properties": {"data": {"$ref": "ris_rrc_list.schema.json"}}}
        },
        {
            "if": {"properties": {"type": {"const": "ris_subscribe_ok"}}},
            "then": {"properties": {"data": {"$ref": "ris_subscribe_ok.schema.json"}}}
        },
        {
            "if": {"properties": {"type": {"const": "pong"}}},
            "then": {"properties": {"data": {"$ref": "pong.schema.json"}}}
        }
    ]
}

