{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rewio-ru/json-schema/rewio-ru-folder-write-v3-schema.json",
  "title": "FolderWriteV3",
  "description": "Ответ на создание и изменение – та же папка плюс список пропущенного.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rewio-ru-openapi.json#/components/schemas/FolderWriteV3",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id",
      "description": "Идентификатор папки."
    },
    "user_id": {
      "type": "integer",
      "title": "User Id",
      "description": "Идентификатор аккаунта – владельца папки."
    },
    "name": {
      "type": "string",
      "title": "Name",
      "description": "Название папки."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "Момент создания папки (UTC, ISO 8601)."
    },
    "parent_folder_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Parent Folder Id",
      "description": "Родительская папка; `null` у папки верхнего уровня."
    },
    "objects": {
      "items": {
        "$ref": "#/$defs/FolderObjectV3"
      },
      "type": "array",
      "title": "Objects",
      "description": "Собственный состав папки – объекты с названиями.",
      "default": []
    },
    "subfolders": {
      "items": {
        "$ref": "#/$defs/FolderV3"
      },
      "type": "array",
      "title": "Subfolders",
      "description": "Подпапки со своим составом.",
      "default": []
    },
    "review_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Review Count",
      "description": "Сколько отзывов в ленте папки (`GET /v3/reviews?folder_id=`): объекты папки и её подпапок, отзыв общей для двух объектов ссылки считается один раз."
    },
    "is_demo": {
      "type": "boolean",
      "title": "Is Demo",
      "description": "Папка примеров, которую кабинет кладёт новому клиенту.",
      "default": false
    },
    "ignored_object_ids": {
      "items": {
        "type": "integer"
      },
      "type": "array",
      "title": "Ignored Object Ids",
      "description": "Идентификаторы из присланного `object_ids`, которые в состав не попали: чужие, удалённые или несуществующие объекты. Запрос при этом выполняется – остальные объекты кладутся в папку."
    }
  },
  "type": "object",
  "required": [
    "id",
    "user_id",
    "name",
    "created_at"
  ],
  "$defs": {
    "FolderObjectV3": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id",
          "description": "Идентификатор объекта."
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Название объекта."
        }
      },
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "FolderObjectV3",
      "description": "Объект в составе папки – идентификатор и название, чтобы не ходить за ними отдельно."
    },
    "FolderV3": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id",
          "description": "Идентификатор папки."
        },
        "user_id": {
          "type": "integer",
          "title": "User Id",
          "description": "Идентификатор аккаунта – владельца папки."
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Название папки."
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At",
          "description": "Момент создания папки (UTC, ISO 8601)."
        },
        "parent_folder_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Parent Folder Id",
          "description": "Родительская папка; `null` у папки верхнего уровня."
        },
        "objects": {
          "items": {
            "$ref": "#/$defs/FolderObjectV3"
          },
          "type": "array",
          "title": "Objects",
          "description": "Собственный состав папки – объекты с названиями.",
          "default": []
        },
        "subfolders": {
          "items": {
            "$ref": "#/$defs/FolderV3"
          },
          "type": "array",
          "title": "Subfolders",
          "description": "Подпапки со своим составом.",
          "default": []
        },
        "review_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Review Count",
          "description": "Сколько отзывов в ленте папки (`GET /v3/reviews?folder_id=`): объекты папки и её подпапок, отзыв общей для двух объектов ссылки считается один раз."
        },
        "is_demo": {
          "type": "boolean",
          "title": "Is Demo",
          "description": "Папка примеров, которую кабинет кладёт новому клиенту.",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "id",
        "user_id",
        "name",
        "created_at"
      ],
      "title": "FolderV3",
      "description": "Папка со своим составом и подпапками."
    }
  }
}