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

