{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Applicability catalog",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "base_documents",
    "runtimes",
    "environments",
    "deliveries",
    "availability",
    "capabilities"
  ],
  "properties": {
    "$schema": {"type": "string"},
    "schema_version": {"const": 1},
    "base_documents": {"$ref": "#/$defs/documents"},
    "runtimes": {
      "type": "object",
      "additionalProperties": false,
      "required": ["kubernetes", "compose"],
      "properties": {
        "kubernetes": {"$ref": "#/$defs/documents"},
        "compose": {"$ref": "#/$defs/documents"}
      }
    },
    "environments": {
      "type": "object",
      "additionalProperties": false,
      "required": ["local", "non-production", "production"],
      "properties": {
        "local": {"$ref": "#/$defs/documents"},
        "non-production": {"$ref": "#/$defs/documents"},
        "production": {"$ref": "#/$defs/documents"}
      }
    },
    "deliveries": {
      "type": "object",
      "additionalProperties": false,
      "required": ["local", "gitlab-ci-agent", "gitlab-ci-runner", "gitops"],
      "properties": {
        "local": {"$ref": "#/$defs/documents"},
        "gitlab-ci-agent": {"$ref": "#/$defs/documents"},
        "gitlab-ci-runner": {"$ref": "#/$defs/documents"},
        "gitops": {"$ref": "#/$defs/documents"}
      }
    },
    "availability": {
      "type": "object",
      "additionalProperties": false,
      "required": ["single-instance", "high-availability"],
      "properties": {
        "single-instance": {"$ref": "#/$defs/documents"},
        "high-availability": {"$ref": "#/$defs/documents"}
      }
    },
    "capabilities": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "postgresql",
        "valkey",
        "nats-jetstream",
        "object-storage",
        "persistent-data",
        "longhorn",
        "public-ingress",
        "infrastructure-as-code"
      ],
      "properties": {
        "postgresql": {"$ref": "#/$defs/documents"},
        "valkey": {"$ref": "#/$defs/documents"},
        "nats-jetstream": {"$ref": "#/$defs/documents"},
        "object-storage": {"$ref": "#/$defs/documents"},
        "persistent-data": {"$ref": "#/$defs/documents"},
        "longhorn": {"$ref": "#/$defs/documents"},
        "public-ingress": {"$ref": "#/$defs/documents"},
        "infrastructure-as-code": {"$ref": "#/$defs/documents"}
      }
    }
  },
  "$defs": {
    "documents": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^docs/[a-z0-9/-]+\\.md$"
      }
    }
  }
}
