{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "additionalProperties": false,
  "id": "https://json.schemastore.org/azure-iot-edgehub-deployment-1.1.json",
  "properties": {
    "$edgeHub": {
      "type": "object",
      "title": "Configuration for the edgeHub module",
      "required": ["properties.desired"],
      "properties": {
        "properties.desired": {
          "type": "object",
          "required": ["schemaVersion", "routes"],
          "properties": {
            "schemaVersion": {
              "type": "string",
              "pattern": "1.1"
            },
            "routes": {
              "type": "object",
              "patternProperties": {
                "^[^\\.\\$# ]+$": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": ["route"],
                      "properties": {
                        "route": {
                          "type": "string",
                          "examples": ["FROM /* INTO $upstream"],
                          "pattern": "^.+$"
                        },
                        "priority": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9
                        },
                        "timeToLiveSecs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 4294967295
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "string",
                      "examples": ["FROM /* INTO $upstream"],
                      "pattern": "^.+$"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "storeAndForwardConfiguration": {
              "type": "object",
              "required": ["timeToLiveSecs"],
              "properties": {
                "timeToLiveSecs": {
                  "type": "integer",
                  "examples": [7200]
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "required": ["$edgeHub"],
  "title": "JSON schema for Azure IoT EdgeHub Deployment version 1.1",
  "type": "object"
}
