{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antfly/json-schema/antfly-install-extension-request-schema.json",
  "title": "InstallExtensionRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/antfly-installed-api-openapi.yml#/components/schemas/InstallExtensionRequest",
  "type": "object",
  "properties": {
    "version": {
      "type": "string"
    },
    "scope": {
      "$ref": "#/$defs/ExtensionScope"
    },
    "config_json": {
      "type": "string",
      "default": "{}"
    },
    "grants": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Capability"
      }
    },
    "dry_run": {
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "scope"
  ],
  "$defs": {
    "Capability": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/CapabilityName"
        },
        "scope": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    },
    "CapabilityName": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_.:-]+$",
      "description": "Capability identifier. Capability names may use colon-delimited namespaces such as read:table."
    },
    "ExtensionScope": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/$defs/ExtensionScopeKind"
        },
        "table_name": {
          "type": "string",
          "description": "Required when kind is table."
        }
      },
      "required": [
        "kind"
      ]
    },
    "ExtensionScopeKind": {
      "type": "string",
      "enum": [
        "cluster",
        "table",
        "embedded_db"
      ]
    }
  }
}