{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://fdc3.finos.org/schemas/2.1/bridging/broadcastAgentRequest.schema.json",
  "title": "Broadcast Agent Request",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/BroadcastRequestBase"
    },
    {
      "$ref": "agentRequest.schema.json"
    }
  ],
  "$defs": {
    "BroadcastRequestBase": {
      "title": "Broadcast Request",
      "type":"object",
      "description": "A request to broadcast context on a channel.",
      "properties": {
        "type": {
          "title": "Broadcast Request Message Type",
          "const": "broadcastRequest"
        },
        "payload": {
          "title": "broadcast Request Payload",
          "type": "object",
          "properties": {
            "channelId": {
              "type": "string",
              "title": "Channel Id",
              "description": "The Id of the Channel that the broadcast was sent on"
            },
            "context": {
              "$ref": "../context/context.schema.json",
              "title": "Context",
              "description": "The context object that was the payload of a broadcast message."
            }
          },
          "additionalProperties": false,
          "required": ["channelId", "context"]
        },
        "meta": {
          "type": "object",
          "title": "broadcast request metadata",
          "properties": {
            "requestUuid": true,
            "timestamp": true,
            "source": {
              "$ref": "common.schema.json#/$defs/AppRequestSource"
            }
          },
          "required": ["source"],
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  }
}
