{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/onclarity-com/json-schema/onclarity-com-admin-update-collection-request-schema.json",
  "title": "AdminUpdateCollectionRequest",
  "description": "Admin variant of the collection edit: explicit project scope, no owner check.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/onclarity-com-agent-store-admin-api-openapi.yml#/components/schemas/AdminUpdateCollectionRequest",
  "properties": {
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Title",
      "description": "New title (non-empty)."
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description",
      "description": "New description ('' clears it)."
    },
    "json_schema": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Json Schema",
      "description": "The complete new JSON Schema of a record (omit to keep it)."
    },
    "indexes": {
      "items": {
        "$ref": "#/$defs/IndexSpec"
      },
      "type": "array",
      "title": "Indexes",
      "description": "ADDITIONAL indexes to create (existing ones are kept unless their field is dropped). Only applied together with json_schema."
    },
    "ticket_link_field": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ticket Link Field",
      "description": "Set the field whose value is a ticket unique_id (text or integer; a field of the new json_schema when one is sent). Omit to keep the current link; send null to unlink."
    },
    "ticket_link_es_field": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ticket Link Es Field",
      "description": "The ES ticket field the link values are matched against. Tri-state per key (omitted = kept): send it alone to retarget the join of the EXISTING link (null = back to unique_id); setting ticket_link_field alone keeps the current join target."
    },
    "project_id": {
      "type": "integer",
      "title": "Project Id",
      "description": "Project the collection belongs to."
    }
  },
  "type": "object",
  "required": [
    "project_id"
  ],
  "$defs": {
    "IndexSpec": {
      "properties": {
        "fields": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Fields",
          "description": "Schema fields the index covers (1..5)."
        },
        "unique": {
          "type": "boolean",
          "title": "Unique",
          "description": "Create as a UNIQUE index.",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "fields"
      ],
      "title": "IndexSpec",
      "description": "One requested index over the collection's dynamic table (btree, scalar fields)."
    }
  }
}