{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/platform-sh-services/latest.json",
  "title": "Platform.sh services configuration file",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/platformsh/platformify/refs/heads/main/validator/schema/platformsh.services.json",
    "sourceSha256": "1362840d603f5b64778152b486e5272b6a05e2a51e77e224f806fac073759874",
    "fileMatch": [
      "**/.platform/services.yml",
      "**/.platform/services.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "additionalProperties": {
    "type": "object",
    "properties": {
      "type": {
        "type": "string",
        "title": "The service type."
      },
      "size": {
        "type": "string",
        "title": "The service size.",
        "default": "AUTO"
      },
      "disk": {
        "type": "integer",
        "title": "The size of the disk.",
        "default": null
      },
      "access": {
        "type": "object",
        "title": "The configuration of the service.",
        "default": {}
      },
      "configuration": {
        "type": "object",
        "title": "The configuration of the service.",
        "default": {}
      },
      "relationships": {
        "type": "object",
        "default": {},
        "title": "The relationships of the service to other services.",
        "additionalProperties": {
          "type": "string"
        }
      },
      "firewall": {
        "type": "object",
        "properties": {
          "outbound": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "protocol": {
                  "type": "string",
                  "title": "The IP protocol to apply the restriction on.",
                  "default": "tcp"
                },
                "ips": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "title": "The IP range in CIDR notation to apply the restriction on.",
                  "default": []
                },
                "domains": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "title": "Domains of the restriction.",
                  "default": []
                },
                "ports": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  },
                  "title": "The port to apply the restriction on.",
                  "default": []
                }
              },
              "additionalProperties": false
            },
            "title": "Outbound firewall restrictions",
            "default": []
          }
        },
        "default": null,
        "nullable": true,
        "title": "Firewall",
        "additionalProperties": false
      },
      "resources": {
        "type": "object",
        "properties": {
          "base_memory": {
            "type": "integer",
            "title": "The base memory for the container",
            "default": 64
          },
          "memory_ratio": {
            "type": "integer",
            "title": "The amount of memory to allocate per units of CPU",
            "default": 128
          }
        },
        "default": null,
        "nullable": true,
        "title": "Resources",
        "additionalProperties": false
      }
    },
    "required": [
      "type"
    ],
    "additionalProperties": false
  }
}
