{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/skycloak-io/json-schema/skycloak-io-extension-schema.json",
  "title": "Extension",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/skycloak-io-openapi.yaml#/components/schemas/Extension",
  "type": "object",
  "required": [
    "id",
    "name",
    "description",
    "source",
    "version",
    "previous_versions",
    "keycloak_versions",
    "parameter_type",
    "parameters",
    "repository_url",
    "icon_url",
    "documentation_url",
    "quick_start_steps",
    "usage_notes",
    "scan_status",
    "scan_message",
    "original_jar_name",
    "file_size_bytes",
    "uploaded_at",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "id": {
      "$ref": "#/$defs/ExtensionId"
    },
    "name": {
      "type": "string",
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      },
      "minLength": 1,
      "maxLength": 200
    },
    "display_name": {
      "type": [
        "string",
        "null"
      ],
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      },
      "maxLength": 200,
      "description": "Friendly name shown in place of `name` when set. `name` never changes once an extension is catalogued; `display_name` lets the shown label change independently. Absent or null when the extension has none, in which case clients should fall back to `name`."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      }
    },
    "source": {
      "$ref": "#/$defs/ExtensionSource"
    },
    "visibility": {
      "allOf": [
        {
          "$ref": "#/$defs/ExtensionVisibility"
        }
      ],
      "description": "Set for `platform` extensions only: `private` marks an early-access extension your workspace has been granted. Absent for `custom` extensions."
    },
    "version": {
      "type": "string",
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      },
      "description": "Active version of the extension. For `platform` extensions this is the newest release across its supported Keycloak versions; the version a given cluster gets is `available_version` on its cluster extension. For `custom` extensions it is the uploader-supplied version."
    },
    "previous_versions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ExtensionVersionInfo"
      },
      "description": "Previously published versions, ordered from oldest to newest."
    },
    "keycloak_versions": {
      "type": "array",
      "items": {
        "type": "string",
        "x-oapi-codegen-extra-tags": {
          "validate": "omitnil,max=500"
        }
      },
      "description": "Supported Keycloak major versions (e.g. `[\"25\", \"26\"]`)."
    },
    "parameter_type": {
      "$ref": "#/$defs/ExtensionParameterType"
    },
    "parameters": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ExtensionParameter"
      }
    },
    "repository_url": {
      "type": [
        "string",
        "null"
      ],
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      },
      "format": "uri"
    },
    "icon_url": {
      "type": [
        "string",
        "null"
      ],
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      },
      "format": "uri"
    },
    "documentation_url": {
      "type": [
        "string",
        "null"
      ],
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      },
      "format": "uri"
    },
    "quick_start_steps": {
      "type": [
        "string",
        "null"
      ],
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      }
    },
    "usage_notes": {
      "type": [
        "string",
        "null"
      ],
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      }
    },
    "scan_status": {
      "allOf": [
        {
          "$ref": "#/$defs/ExtensionScanStatus"
        }
      ],
      "nullable": true,
      "description": "Malware scan result. Only set for `custom` extensions."
    },
    "scan_message": {
      "type": [
        "string",
        "null"
      ],
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      },
      "description": "Human-readable scan result. Present when `scan_status` is `rejected` (names the detected signature) or `failed` (says the scan could not complete)."
    },
    "original_jar_name": {
      "type": [
        "string",
        "null"
      ],
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      },
      "description": "Original JAR filename provided at upload time. Only set for `custom` extensions."
    },
    "file_size_bytes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "JAR file size in bytes. Only set for `custom` extensions."
    },
    "uploaded_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the extension was first uploaded. Only set for `custom` extensions."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "ExtensionId": {
      "type": "string",
      "format": "uuid"
    },
    "ExtensionParameter": {
      "type": "object",
      "required": [
        "key",
        "label",
        "type",
        "required",
        "default_value",
        "options",
        "is_sensitive"
      ],
      "properties": {
        "key": {
          "type": "string",
          "x-oapi-codegen-extra-tags": {
            "validate": "omitnil,max=500"
          },
          "minLength": 1,
          "maxLength": 100,
          "description": "Unique parameter identifier within the extension."
        },
        "label": {
          "type": "string",
          "x-oapi-codegen-extra-tags": {
            "validate": "omitnil,max=500"
          },
          "minLength": 1,
          "maxLength": 200
        },
        "type": {
          "$ref": "#/$defs/ExtensionParameterFieldType"
        },
        "required": {
          "type": "boolean"
        },
        "default_value": {
          "type": [
            "string",
            "null"
          ],
          "x-oapi-codegen-extra-tags": {
            "validate": "omitnil,max=500"
          }
        },
        "options": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtensionParameterOption"
          },
          "description": "Available choices. Only applicable when `type` is `dropdown`."
        },
        "is_sensitive": {
          "type": "boolean",
          "description": "When `true`, the parameter value is write-only and omitted from read responses."
        }
      }
    },
    "ExtensionParameterFieldType": {
      "type": "string",
      "enum": [
        "text",
        "dropdown",
        "checkbox",
        "number",
        "password"
      ]
    },
    "ExtensionParameterOption": {
      "type": "object",
      "required": [
        "value",
        "label"
      ],
      "properties": {
        "value": {
          "type": "string",
          "x-oapi-codegen-extra-tags": {
            "validate": "omitnil,max=500"
          }
        },
        "label": {
          "type": "string",
          "x-oapi-codegen-extra-tags": {
            "validate": "omitnil,max=500"
          }
        }
      }
    },
    "ExtensionParameterType": {
      "type": "string",
      "enum": [
        "env",
        "cli",
        "realm_attributes"
      ]
    },
    "ExtensionScanStatus": {
      "type": "string",
      "enum": [
        "scanning",
        "ready",
        "rejected",
        "failed"
      ]
    },
    "ExtensionSource": {
      "type": "string",
      "enum": [
        "platform",
        "custom"
      ]
    },
    "ExtensionVersionInfo": {
      "type": "object",
      "required": [
        "version",
        "created_at"
      ],
      "properties": {
        "version": {
          "type": "string",
          "x-oapi-codegen-extra-tags": {
            "validate": "omitnil,max=500"
          }
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "ExtensionVisibility": {
      "type": "string",
      "enum": [
        "public",
        "private"
      ]
    }
  }
}