{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/handover-sh/json-schema/handover-sh-create-connector-source-schema.json",
  "title": "CreateConnectorSource",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/handover-sh-openapi.json#/components/schemas/CreateConnectorSource",
  "type": "object",
  "required": [
    "displayName",
    "provider",
    "config"
  ],
  "properties": {
    "displayName": {
      "type": "string",
      "maxLength": 120
    },
    "workspaceId": {
      "type": "string",
      "pattern": "^wsp_"
    },
    "provider": {
      "type": "string",
      "enum": [
        "github",
        "http"
      ]
    },
    "config": {
      "oneOf": [
        {
          "type": "object",
          "title": "GitHub folder source",
          "required": [
            "owner",
            "repository"
          ],
          "properties": {
            "owner": {
              "type": "string"
            },
            "repository": {
              "type": "string"
            },
            "branch": {
              "type": "string",
              "default": "main"
            },
            "path": {
              "type": "string",
              "default": ""
            }
          }
        },
        {
          "type": "object",
          "title": "Signed HTTP source",
          "required": [
            "secretEnv"
          ],
          "properties": {
            "secretEnv": {
              "type": "string",
              "pattern": "^HANDOVER_IMPORT_[A-Z0-9_]*SECRET[A-Z0-9_]*$",
              "description": "Runtime environment key containing the HMAC secret. The secret value is never stored in source metadata."
            }
          }
        }
      ]
    }
  }
}