{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://fdc3.finos.org/schemas/2.1/bridging/bridgeErrorResponse.schema.json",
  "title": "Bridge Error Response Message",
  "type": "object",
  "description": "A response message from the Bridge back to the original Desktop Agent that raised the request, used where all connected agents returned errors.",
  "properties": {
    "type": {
      "title": "Response Message Type",
      "type": "string",
      "description": "Identifies the type of the message and it is typically set to the FDC3 function name that the message relates to, e.g. 'findIntent', with 'Response' appended."
    },
    "payload": {
      "title": "Response Error Message Payload",
      "type": "object",
      "description": "The error message payload contains details of an error return to the app or agent that raised the original request.",
      "properties": {
        "error": {
          "$ref": "common.schema.json#/$defs/ErrorMessages"
        }
      }
    },
    "meta": {
      "$ref": "#/$defs/BridgeErrorResponseMeta"
    }
  },
  "required": ["type", "payload", "meta"],
  "additionalProperties": false,
  "$defs": {
    "BridgeErrorResponseMeta": {
      "title": "Bridge Response Metadata",
      "description": "Metadata required in a response message collated and/or forwarded on by the Bridge",
      "type": "object",
      "properties": {
        "requestUuid": {
          "$ref": "common.schema.json#/$defs/RequestUuid"
        },
        "responseUuid": {
          "$ref": "common.schema.json#/$defs/ResponseUuid"
        },
        "timestamp": {
          "$ref": "common.schema.json#/$defs/Timestamp"
        },
        "errorSources": {
         "$ref": "common.schema.json#/$defs/BridgeResponseErrorSources"
        },
        "errorDetails": {
          "$ref": "common.schema.json#/$defs/BridgeResponseErrorDetails"
        }
      },
      "required": ["requestUuid", "responseUuid", "timestamp", "errorSources", "errorDetails"],
      "additionalProperties": false
    }
  }
}
