{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hivehall-ai/json-schema/hivehall-ai-create-schema.json",
  "title": "Create",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hivehall-ai-openapi.json#/components/schemas/Create",
  "properties": {
    "idempotency_key": {
      "type": "string",
      "maxLength": 128,
      "minLength": 1,
      "title": "Idempotency Key"
    },
    "title": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1,
      "title": "Title"
    },
    "name": {
      "type": "string",
      "maxLength": 64,
      "minLength": 1,
      "title": "Name"
    },
    "description": {
      "type": "string",
      "maxLength": 1024,
      "minLength": 1,
      "title": "Description"
    },
    "compatibility": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Compatibility"
    },
    "license": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "License"
    },
    "tags": {
      "items": {
        "type": "string",
        "maxLength": 64,
        "minLength": 1
      },
      "type": "array",
      "maxItems": 20,
      "title": "Tags",
      "default": []
    },
    "rights_confirmed": {
      "type": "boolean",
      "title": "Rights Confirmed",
      "default": false
    },
    "skill_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 96,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Skill Id"
    },
    "source_version_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 96,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Version Id"
    },
    "source_context": {
      "anyOf": [
        {
          "oneOf": [
            {
              "$ref": "#/$defs/Own"
            },
            {
              "$ref": "#/$defs/Campaign"
            },
            {
              "$ref": "#/$defs/Task"
            },
            {
              "$ref": "#/$defs/Run"
            },
            {
              "$ref": "#/$defs/Review"
            }
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Context"
    },
    "derivation_reason": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Derivation Reason"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "idempotency_key",
    "title",
    "name",
    "description"
  ],
  "$defs": {
    "Campaign": {
      "properties": {
        "scope": {
          "type": "string",
          "const": "CAMPAIGN",
          "title": "Scope"
        },
        "campaign_id": {
          "type": "string",
          "maxLength": 96,
          "minLength": 1,
          "title": "Campaign Id"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "scope",
        "campaign_id"
      ],
      "title": "Campaign"
    },
    "Own": {
      "properties": {
        "scope": {
          "type": "string",
          "const": "OWN",
          "title": "Scope"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "scope"
      ],
      "title": "Own"
    },
    "Review": {
      "properties": {
        "scope": {
          "type": "string",
          "const": "ARENA_REVIEW",
          "title": "Scope"
        },
        "challenge_version_id": {
          "type": "string",
          "maxLength": 96,
          "minLength": 1,
          "title": "Challenge Version Id"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "scope",
        "challenge_version_id"
      ],
      "title": "Review"
    },
    "Run": {
      "properties": {
        "scope": {
          "type": "string",
          "const": "ARENA_RUN",
          "title": "Scope"
        },
        "run_id": {
          "type": "string",
          "maxLength": 96,
          "minLength": 1,
          "title": "Run Id"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "scope",
        "run_id"
      ],
      "title": "Run"
    },
    "Task": {
      "properties": {
        "scope": {
          "type": "string",
          "const": "TASK",
          "title": "Scope"
        },
        "task_id": {
          "type": "string",
          "maxLength": 96,
          "minLength": 1,
          "title": "Task Id"
        },
        "lease_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 96,
              "minLength": 1
            },
            {
              "type": "null"
            }
          ],
          "title": "Lease Id"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "scope",
        "task_id"
      ],
      "title": "Task"
    }
  }
}