{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "https://json.schemastore.org/servicehub.service.schema.json",
  "properties": {
    "host": {
      "type": "string",
      "description": "The name of the host that should activate the service."
    },
    "hostId": {
      "type": "string",
      "pattern": "^[^ ]*$",
      "description": "A non-empty value will cause this service to be activated on a dedicated host with this ID. All services with the same host / hostId combination will run in the same host process such that they may share global data. If unspecified or empty, a service will share its host process with other services that require the same host and also leave this field empty. If specified, the value must not have spaces in it."
    },
    "hostGroupAllowed": {
      "type": "boolean",
      "description": "A value of 'true' will allow a client to specify a host group when requesting this service."
    },
    "entryPoint": {
      "type": "object",
      "description": "Host-specific parameters that describe how to activate this service.",
      "oneOf": [
        {
          "type": "object",
          "required": ["assemblyPath", "fullClassName"],
          "properties": {
            "assemblyPath": {
              "type": "string",
              "description": "The path to the assembly that carries the service entrypoint class, relative to this file."
            },
            "fullClassName": {
              "type": "string",
              "description": "The full name of the class to instantiate (that accepts a Stream in its constructor) when a new client requests this service."
            },
            "appBasePath": {
              "type": "string",
              "description": "The path that the AppDomain hosting the service should be configured to consider the ApplicationBase, relative to this file."
            },
            "configPath": {
              "type": "string",
              "description": "The config file used to initialize the service's AppDomain. It may be omitted if the config file has the same name (+.config) as the service assembly, and resides in the same directory. It is also possible to have the service without the config file."
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": ["scriptPath", "constructorFunction"],
          "properties": {
            "scriptPath": {
              "type": "string",
              "description": "The path to the .js file to 'require', relative to this file."
            },
            "constructorFunction": {
              "type": "string",
              "description": "The name of the constructor function to use (that accepts a stream) when a new client requests this service."
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "versionRange": {
      "type": "string",
      "description": "Defines the version of the service."
    }
  },
  "required": ["host", "entryPoint"],
  "title": "Microsoft ServiceHub Service",
  "type": "object"
}