{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/samva-dev/json-schema/samva-dev-extension-schema.json",
  "title": "Extension",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/samva-dev-extensions-api-openapi.yml#/components/schemas/Extension",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/ExtensionId"
    },
    "name": {
      "type": "string"
    },
    "displayName": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "runtime": {
      "type": "string",
      "enum": [
        "hosted",
        "webhook"
      ]
    },
    "latestVersion": {
      "$ref": "#/$defs/ExtensionVersionRef"
    },
    "createdAt": {
      "type": "string"
    },
    "updatedAt": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "name",
    "displayName",
    "description",
    "runtime",
    "latestVersion",
    "createdAt",
    "updatedAt"
  ],
  "additionalProperties": false,
  "$defs": {
    "ExtensionId": {
      "type": "string",
      "pattern": "^ext_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "ExtensionId"
    },
    "ExtensionVersionId": {
      "type": "string",
      "pattern": "^extver_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "ExtensionVersionId"
    },
    "ExtensionVersionRef": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/ExtensionVersionId"
        },
        "version": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "version"
      ],
      "additionalProperties": false
    }
  }
}