{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/akeda-ru/json-schema/akeda-ru-chat-folder-schema.json",
  "title": "ChatFolder",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/akeda-ru-chat-api-openapi.yml#/components/schemas/ChatFolder",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "name",
    "position",
    "space",
    "scopes",
    "include_conversation_ids",
    "exclude_conversation_ids",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "id": {
      "$ref": "#/$defs/UUID"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    },
    "position": {
      "type": "integer",
      "minimum": 0
    },
    "space": {
      "type": "string",
      "enum": [
        "chats",
        "tasks"
      ],
      "description": "Верхний уровень списка; папка не может одновременно принадлежать обычным чатам и чатам задач."
    },
    "scopes": {
      "type": "array",
      "maxItems": 3,
      "description": "Разделы всегда возвращаются в порядке direct, group, task независимо от порядка в запросе.",
      "items": {
        "type": "string",
        "enum": [
          "direct",
          "group",
          "task"
        ]
      }
    },
    "include_conversation_ids": {
      "type": "array",
      "maxItems": 200,
      "items": {
        "$ref": "#/$defs/UUID"
      }
    },
    "exclude_conversation_ids": {
      "type": "array",
      "maxItems": 200,
      "items": {
        "$ref": "#/$defs/UUID"
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "UUID": {
      "type": "string",
      "format": "uuid"
    }
  }
}