{
  "$id": "https://firefox-ci-tc.services.mozilla.com/schemas/common/exchanges-reference-v0.json#",
  "$schema": "https://firefox-ci-tc.services.mozilla.com/schemas/common/metadata-metaschema.json#",
  "additionalProperties": false,
  "description": "Reference of exchanges published",
  "metadata": {
    "name": "exchanges",
    "version": 0
  },
  "properties": {
    "$schema": {
      "description": "Link to schema for this reference. That is a link to this very document. Typically used to identify what kind of reference this file is.",
      "format": "uri",
      "title": "Schema Reference",
      "type": "string"
    },
    "apiVersion": {
      "description": "Version of the API",
      "pattern": "^v[0-9]+$",
      "type": "string"
    },
    "description": {
      "description": "Description of set of exchanges in markdown",
      "type": "string"
    },
    "entries": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "description": "Description (ie. documentation) for the exchange",
            "type": "string"
          },
          "exchange": {
            "description": "Exchange name on AMQP server, must be prefixed with `exchangePrefix` from this document.",
            "type": "string"
          },
          "name": {
            "description": "Name of exchange, this is a stable identifier for use in auto-generated client libraries",
            "type": "string"
          },
          "routingKey": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "constant": {
                  "description": "Constant to be used for this field, cannot be overwritten, only present if applicable.",
                  "type": "string"
                },
                "multipleWords": {
                  "description": "True, if key may contain dots, which AMQP will consider as words. This determines if `#` or `*` should be used in client libraries",
                  "type": "boolean"
                },
                "name": {
                  "description": "Identifier usable in client libraries",
                  "type": "string"
                },
                "required": {
                  "description": "True, if the key is always present, if `false` the value `_` will be used in place when no appropriate value is available for the key.",
                  "type": "boolean"
                },
                "summary": {
                  "description": "Short description of key in markdown",
                  "type": "string"
                }
              },
              "required": [
                "name",
                "summary",
                "multipleWords",
                "required"
              ],
              "type": "object"
            },
            "type": "array",
            "uniqueItems": true
          },
          "schema": {
            "description": "JSON schema for messages on this exchange. The value must be a relative URI, based on the service's schema location; that is, based at `<rootUrl>/schemas/<serviceName>`.",
            "type": "string"
          },
          "title": {
            "description": "Title of exchange entry",
            "type": "string"
          },
          "type": {
            "const": "topic-exchange",
            "description": "Type of entry, currently only `topic-exchange`.",
            "type": "string"
          }
        },
        "required": [
          "type",
          "exchange",
          "name",
          "title",
          "description",
          "routingKey",
          "schema"
        ],
        "type": "object"
      },
      "type": "array",
      "uniqueItems": true
    },
    "exchangePrefix": {
      "description": "Prefix for all exchanges described in this document",
      "type": "string"
    },
    "serviceName": {
      "description": "Name of service for automation. Will be consumed by client generators to produce URLs",
      "maxLength": 22,
      "minLength": 1,
      "pattern": "^[a-z][a-z0-9_-]*$",
      "type": "string"
    },
    "title": {
      "description": "Title for set of exchanges in markdown",
      "type": "string"
    }
  },
  "required": [
    "apiVersion",
    "$schema",
    "serviceName",
    "title",
    "description",
    "exchangePrefix",
    "entries"
  ],
  "title": "Exchange Reference File",
  "type": "object"
}