{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antismi-media/json-schema/antismi-media-word-cloud-request-schema.json",
  "title": "WordCloudRequest",
  "description": "Запрос на генерацию облака слов",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/antismi-media-openapi.json#/components/schemas/WordCloudRequest",
  "properties": {
    "date": {
      "type": "string",
      "format": "date-time",
      "title": "Date",
      "description": "Дата дайджеста"
    },
    "period": {
      "allOf": [
        {
          "$ref": "#/$defs/DigestPeriod"
        }
      ],
      "description": "Период дня",
      "default": "all"
    },
    "categories": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Categories",
      "description": "Список категорий"
    },
    "telegram_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Telegram Id",
      "description": "Telegram ID пользователя (legacy)"
    },
    "user_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "User Id",
      "description": "Surrogate user ID"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Timezone",
      "description": "Часовой пояс пользователя",
      "default": "UTC"
    },
    "period_end": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Period End",
      "description": "Опциональная конечная дата периода"
    },
    "width": {
      "type": "integer",
      "title": "Width",
      "description": "Ширина изображения",
      "default": 1600
    },
    "height": {
      "type": "integer",
      "title": "Height",
      "description": "Высота изображения",
      "default": 800
    },
    "background_color": {
      "type": "string",
      "title": "Background Color",
      "description": "Цвет фона",
      "default": "black"
    },
    "mode": {
      "type": "string",
      "title": "Mode",
      "description": "Режим: 'general' — топ по абсолютной частоте упоминаний, 'trends' — топ по z-score относительно baseline-окна 90д (выделяет события дня, подавляет фоновую лексику).",
      "default": "general"
    },
    "lang": {
      "type": "string",
      "enum": [
        "ru",
        "en"
      ],
      "title": "Lang",
      "description": "Язык метаданных: en → заголовки/резюме/понятия из *_en с fallback на русский (миграция 030)",
      "default": "ru"
    }
  },
  "type": "object",
  "required": [
    "date"
  ],
  "$defs": {
    "DigestPeriod": {
      "type": "string",
      "enum": [
        "all",
        "morning",
        "day",
        "evening",
        "night"
      ],
      "title": "DigestPeriod",
      "description": "Периоды дайджестов"
    }
  }
}