{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "https://json.schemastore.org/servicehub.config.schema.json",
  "properties": {
    "controller": {
      "type": "object",
      "description": "Specifies the location of the controller executable and activation parameters.",
      "required": ["executable"],
      "properties": {
        "contextEnvironmentVariables": {
          "type": "array",
          "description": "Array of environment variable names. These variables are mixed-up into hash that determines the location service pipe name. The order is significant.",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "executable": {
          "type": "string"
        },
        "args": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "additionalEnvironmentVariables": {
          "type": "object",
          "description": "An object with properties like \"environment variable name\": \"value\" that describes what environment variables to set for the Hub Controller.",
          "additionalProperties": false,
          "patternProperties": {
            "^[A-Za-z0-9_/\\.]+$": {
              "type": "string",
              "description": "The value of the environment variable to set."
            }
          }
        }
      },
      "hosts": {
        "type": "object",
        "required": ["rootDir"],
        "properties": {
          "rootDir": {
            "type": "string",
            "description": "The path to the directory immediately under which are folders that contain *.servicehub.host.json files."
          }
        }
      },
      "services": {
        "type": "object",
        "required": ["rootDir"],
        "properties": {
          "rootDir": {
            "type": "string",
            "description": "The path to the directory immediately under which are folders that contain *.servicehub.service.json files."
          },
          "discoveryServices": {
            "description": "Service names of optional discovery service modules. Controller will use them to locate a service which it cannot find in the services folder.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "required": ["controller", "hosts", "services"],
  "title": "Microsoft ServiceHub Configuration",
  "type": "object"
}
