{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/dwp-exchange-gateway/_shared/latest--service-schema.json",
  "title": "Service",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/dwp/schemas/main/exchange/publishing-tools/service-schema.json",
    "sourceSha256": "e3b888b7e762ad5a48cd2c05662d172961a71f5696c4de842362cb3d53f9aebd"
  },
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 2,
      "description": "The service name"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "pattern": "^(https?)://",
      "description": "The URL of the service you are attempting to communicate with.\nThe format is `protocol://host:port.\nIf a port is not supplied, the default port for the given protocol is used."
    },
    "timeout": {
      "title": "Timeout",
      "type": "object",
      "properties": {
        "secs": {
          "type:": "integer",
          "exclusiveMinimum": 0,
          "maximum": 900,
          "default": 60
        },
        "retries": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10,
          "default": 5
        }
      },
      "required": [
        "retries",
        "secs"
      ],
      "additionalProperties": false
    },
    "tls_verify_upstream": {
      "type": "boolean",
      "default": true
    },
    "tls_verify_depth": {
      "type": "integer",
      "default": 0,
      "minimum": 0,
      "maximum": 9
    },
    "additional_ca_certs": {
      "title": "Additional certificates",
      "type": "array",
      "prefixItems": [
        {
          "type": "string"
        }
      ]
    },
    "routes": {
      "title": "Routes",
      "type": "array",
      "items": {
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/dwp-exchange-gateway/_shared/latest--route-schema.json"
      }
    },
    "plugins": {
      "title": "Plugins",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/dwp-exchange-gateway/_shared/latest--plugins-schema.json"
      }
    }
  },
  "required": [
    "name",
    "url",
    "timeout"
  ],
  "additionalProperties": false
}
