{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/skycloak-io/json-schema/skycloak-io-cluster-extension-schema.json",
  "title": "ClusterExtension",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/skycloak-io-openapi.yaml#/components/schemas/ClusterExtension",
  "type": "object",
  "required": [
    "extension_id",
    "extension_name",
    "extension_source",
    "status",
    "installed_version",
    "available_version",
    "upgrade_available",
    "parameters",
    "installed_at",
    "last_status_change_at"
  ],
  "properties": {
    "extension_id": {
      "$ref": "#/$defs/ExtensionId"
    },
    "extension_name": {
      "type": "string",
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      }
    },
    "extension_source": {
      "$ref": "#/$defs/ExtensionSource"
    },
    "status": {
      "$ref": "#/$defs/ClusterExtensionStatus"
    },
    "installed_version": {
      "type": "string",
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      },
      "description": "Version currently running on the cluster. For `platform` extensions this is the upstream release string of the installed build (not necessarily semver, for example `1.4.1-SNAPSHOT`), or `unknown` when it cannot be determined. For `custom` extensions it is the uploader-supplied version."
    },
    "available_version": {
      "type": [
        "string",
        "null"
      ],
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      },
      "description": "Version the cluster would get by upgrading now. For `platform` extensions it is the build published for the cluster's Keycloak version (`unknown` when that build states no version), and `null` when no build supports the cluster's Keycloak version. For `custom` extensions it is the latest uploaded version."
    },
    "upgrade_available": {
      "type": "boolean",
      "description": "Whether upgrading would install a different build. For `platform` extensions it compares the installed build with the one published for the cluster's Keycloak version, so republishing an unchanged catalog never sets it. For `custom` extensions it is set when a version was published after the install. Always `false` when the install is not `active` or is pinned by Skycloak support."
    },
    "parameters": {
      "type": "object",
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ],
        "x-oapi-codegen-extra-tags": {
          "validate": "omitnil,max=500"
        }
      },
      "description": "Current parameter values. Values for sensitive parameters are omitted (`null`)."
    },
    "installed_at": {
      "type": "string",
      "format": "date-time"
    },
    "last_status_change_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the installation status last changed."
    }
  },
  "$defs": {
    "ClusterExtensionStatus": {
      "type": "string",
      "enum": [
        "installing",
        "active",
        "failed",
        "removing"
      ]
    },
    "ExtensionId": {
      "type": "string",
      "format": "uuid"
    },
    "ExtensionSource": {
      "type": "string",
      "enum": [
        "platform",
        "custom"
      ]
    }
  }
}