{
  "id":           "http://schemas.taskcluster.net/base/v1/exchanges-reference.json#",
  "$schema":      "http://json-schema.org/draft-04/schema#",
  "title":        "Exchange Reference File",
  "description":  "Reference of exchanges published",
  "type":         "object",
  "properties": {
    "version": {
      "description":          "Exchange reference version",
      "enum":                 [0, "0.2.0"]
    },
    "$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.",
      "title":                "Schema Reference",
      "type":                 "string",
      "format":               "uri"
    },
    "title": {
      "description":          "Title for set of exchanges in markdown",
      "type":                 "string"
    },
    "description": {
      "description":          "Description of set of exchanges in markdown",
      "type":                 "string"
    },
    "exchangePrefix": {
      "description":          "Prefix for all exchanges described in this document",
      "type":                 "string"
    },
    "entries": {
      "type":                 "array",
      "items": {
        "type":               "object",
        "properties": {
          "type": {
            "description":    "Type of entry, currently only `topic-exchange`.",
            "type":           "string",
            "enum":           ["topic-exchange"]
          },
          "exchange": {
            "type":           "string",
            "description":    "Exchange name on AMQP server, must be prefixed with `exchangePrefix` from this document."
          },
          "name": {
            "type":           "string",
            "description":    "Name of exchange, this is a stable identifier for use in auto-generated client libraries"
          },
          "title": {
            "type":           "string",
            "description":    "Title of exchange entry"
          },
          "description": {
            "type":           "string",
            "description":    "Description (ie. documentation) for the exchange"
          },
          "routingKey": {
            "type":           "array",
            "items": {
              "type":         "object",
              "properties": {
                "name": {
                  "type":         "string",
                  "description":  "Identifier usable in client libraries"
                },
                "summary": {
                  "type":         "string",
                  "description":  "Short description of key in markdown"
                },
                "constant": {
                  "type":         "string",
                  "description":  "Constant to be used for this field, cannot be overwritten, only present if applicable."
                },
                "multipleWords": {
                  "type":         "boolean",
                  "description":  "True, if key may contain dots, which AMQP will consider as words. This determines if `#` or `*` should be used in client libraries"
                },
                "required": {
                  "type":         "boolean",
                  "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."
                }
              },
              "additionalProperties": false,
              "required": [
                "name", "summary", "multipleWords", "required"
              ]
            }
          },
          "schema": {
            "type":           "string",
            "format":         "uri",
            "description":    "JSON schema for messages posted on this exchange"
          }
        },
        "additionalProperties":   false,
        "required": [
          "type", "exchange", "name", "title", "description", "routingKey",
          "schema"
        ]
      }
    }
  },
  "additionalProperties":   false,
  "required": ["version", "$schema", "title", "description", "exchangePrefix", "entries"]
}