From 4c74aa22f53f7a567af924fb2a93a20ab06e8163 Mon Sep 17 00:00:00 2001 From: Denis Date: Fri, 22 May 2026 13:46:56 +0300 Subject: [PATCH] =?UTF-8?q?H-3656/H-3657:=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20smoke-=D1=82=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=B0=20=D0=BD=D0=B0=20denis.hrbox.io?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Listing-схемы (Wallet/WalletTransaction/FileProcessing/UserApiToken{,Admin}): добавил optional поле `_links` — оно реально возвращается Yii Pagination на index-эндпоинтах и без него клиент-генератор не видит поле. - FileProcessing: дополнил схему полями, которые реально приходят в ответе без `?expand=`: * `file` — объект с метаданными файла-источника (name, ext, url, ...) * `created`/`started`/`finished` — локализованные строки для отображения Уточнил `arguments` и `result` (oneOf object/array). Все остальные эндпоинты (admin/wallet[/view], admin/wallet-transaction[/view], admin/wallet-transaction/{create,create-from-excel,excel-processing}, file-processing[/view], user-api-token, admin/user-api-token) после прогона smoke-теста соответствуют документации: - response shape ↔ schema - 400 на not-uuid id - 404 на несуществующий id - per-page>100 clamps к 100 - 200 с {success:false, errors:[...]} на пустой POST - 200 с {success:false, message:{type:warning, text:"Обработка файла не найдена"}} на несуществующий file_processing_id - 403 на /user-api-token и /admin/user-api-token под Bearer Co-Authored-By: Claude Opus 4.7 (1M context) --- v2/swagger.yaml | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/v2/swagger.yaml b/v2/swagger.yaml index 537ba02..c8035c4 100644 --- a/v2/swagger.yaml +++ b/v2/swagger.yaml @@ -12379,6 +12379,8 @@ components: type: array items: $ref: '#/components/schemas/Wallet' + _links: + $ref: '#/components/schemas/_links' _meta: $ref: '#/components/schemas/_meta' @@ -12411,6 +12413,8 @@ components: type: array items: $ref: '#/components/schemas/WalletTransaction' + _links: + $ref: '#/components/schemas/_links' _meta: $ref: '#/components/schemas/_meta' @@ -12490,10 +12494,13 @@ components: 1 — NEW, 2 — QUEUED, 3 — STARTED, 4 — FINISHED, 5 — ERROR, 6 — FATAL arguments: type: array - result: - type: object description: | - Результат. Для wallet-excel содержит: + Аргументы воркера. Для wallet-excel: `[WalletExcelProcessor::class, mappings]`. + Для excel-экспорта: `[ReportClass::class, params]`. + items: {} + result: + description: | + Результат. Для wallet-excel: ``` { "summary": { "totalRows": 4, "validCount": 1, "invalidCount": 3 }, @@ -12501,9 +12508,32 @@ components: "invalidRows": [{ "row": 2, "errors": {...} }, ...] } ``` + Для незавершённой обработки или экспорта — пустой массив `[]`. + oneOf: + - type: object + - type: array + items: {} created_at: { type: string } started_at: { type: string, nullable: true } finished_at: { type: string, nullable: true } + file: + type: object + nullable: true + description: | + Метаданные файла-источника. Возвращается всегда (не нужно `?expand=`). + Содержит `id, name, ext, fid, url, file_type, mime_type, size, + file_status_id, user_id, created_at` и др. + created: + type: string + description: 'Локализованная `created_at` (например `04.05.2026 at 13:56`).' + started: + type: string + nullable: true + description: Локализованная `started_at`. + finished: + type: string + nullable: true + description: Локализованная `finished_at`. FileProcessingList: type: object @@ -12512,6 +12542,8 @@ components: type: array items: $ref: '#/components/schemas/FileProcessing' + _links: + $ref: '#/components/schemas/_links' _meta: $ref: '#/components/schemas/_meta' @@ -12567,6 +12599,8 @@ components: type: array items: $ref: '#/components/schemas/UserApiToken' + _links: + $ref: '#/components/schemas/_links' _meta: $ref: '#/components/schemas/_meta' @@ -12634,6 +12668,8 @@ components: type: array items: $ref: '#/components/schemas/UserApiTokenAdmin' + _links: + $ref: '#/components/schemas/_links' _meta: $ref: '#/components/schemas/_meta'