From 801eee915a7c07ec94c57c1c4c61eda6119474cd Mon Sep 17 00:00:00 2001 From: Dmitri Sashchenko Date: Thu, 22 Oct 2026 18:43:47 +0600 Subject: [PATCH] =?UTF-8?q?fix(swagger):=20=D0=BF=D0=BE=D1=87=D0=B8=D0=BD?= =?UTF-8?q?=D0=B8=D0=BB=20=D1=80=D0=B5=D0=BD=D0=B4=D0=B5=D1=80=20=D0=B2=20?= =?UTF-8?q?Gitea=20(openapi-swagger)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - js-yaml 5 (парсер Gitea) падает на deficient indentation: закрывающие } flow-маппингов example стояли на уровне ключа-родителя - /survey/index: коды 400-500 были вложены в 200, у 200 не было description - /goal/*: responses ссылался $ref'ом целиком на components/responses; GoalIndexResponse содержал карту кодов вместо Response, а схема GoalActionResponse лежала в components/responses — перенёс в schemas Co-Authored-By: Claude Opus 5.5 --- v2/swagger.yaml | 222 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 155 insertions(+), 67 deletions(-) diff --git a/v2/swagger.yaml b/v2/swagger.yaml index f7cca68..bd0d5a4 100644 --- a/v2/swagger.yaml +++ b/v2/swagger.yaml @@ -1112,7 +1112,7 @@ paths: example: { "type": "success", "text": "Запись установлена основной!" - } + } errors: description: Array of validation errors. type: array @@ -5686,6 +5686,7 @@ paths: responses: 200: + description: Список опросов content: application/json: schema: @@ -5699,16 +5700,16 @@ paths: $ref: '#/components/schemas/_links' _meta: $ref: '#/components/schemas/_meta' - 400: - description: Bad Request. - 401: - description: Unauthorized. - 403: - description: Unauthorized. - 404: - description: Not found. - 500: - description: Server Error. + 400: + description: Bad Request. + 401: + description: Unauthorized. + 403: + description: Unauthorized. + 404: + description: Not found. + 500: + description: Server Error. /survey-assignment/index: get: @@ -6021,7 +6022,16 @@ paths: - $ref: '#/components/parameters/noDraft' - $ref: '#/components/parameters/goalParentId' responses: - $ref: '#/components/responses/GoalActionResponse' + 200: + $ref: '#/components/responses/GoalIndexResponse' + 400: + description: Bad Request. + 403: + description: Unauthorized. + 404: + description: Not found. + 500: + description: Server Error. /goal/supervise: get: @@ -6041,7 +6051,16 @@ paths: - $ref: '#/components/parameters/noDraft' - $ref: '#/components/parameters/goalParentId' responses: - $ref: '#/components/responses/GoalActionResponse' + 200: + $ref: '#/components/responses/GoalIndexResponse' + 400: + description: Bad Request. + 403: + description: Unauthorized. + 404: + description: Not found. + 500: + description: Server Error. /goal/archive: get: @@ -6060,7 +6079,16 @@ paths: - $ref: '#/components/parameters/goalParentId' - $ref: '#/components/parameters/goalIntervalTypeId' responses: - $ref: '#/components/responses/GoalActionResponse' + 200: + $ref: '#/components/responses/GoalIndexResponse' + 400: + description: Bad Request. + 403: + description: Unauthorized. + 404: + description: Not found. + 500: + description: Server Error. /goal/view: get: @@ -6162,7 +6190,16 @@ paths: items: $ref: '#/components/schemas/GoalItem' responses: - $ref: '#/components/responses/GoalActionResponse' + 200: + $ref: '#/components/responses/GoalActionResponse' + 400: + description: Bad Request. + 403: + description: Unauthorized. + 404: + description: Not found. + 500: + description: Server Error. /goal/approve: post: @@ -6183,7 +6220,16 @@ paths: items: $ref: '#/components/schemas/GoalItem' responses: - $ref: '#/components/responses/GoalActionResponse' + 200: + $ref: '#/components/responses/GoalActionResponse' + 400: + description: Bad Request. + 403: + description: Unauthorized. + 404: + description: Not found. + 500: + description: Server Error. /goal/reject: post: @@ -6204,7 +6250,16 @@ paths: items: $ref: '#/components/schemas/GoalItem' responses: - $ref: '#/components/responses/GoalActionResponse' + 200: + $ref: '#/components/responses/GoalActionResponse' + 400: + description: Bad Request. + 403: + description: Unauthorized. + 404: + description: Not found. + 500: + description: Server Error. /goal/finish: post: @@ -6225,7 +6280,16 @@ paths: items: $ref: '#/components/schemas/GoalItem' responses: - $ref: '#/components/responses/GoalActionResponse' + 200: + $ref: '#/components/responses/GoalActionResponse' + 400: + description: Bad Request. + 403: + description: Unauthorized. + 404: + description: Not found. + 500: + description: Server Error. /goal/remove: post: @@ -6246,7 +6310,16 @@ paths: type: string format: uuid responses: - $ref: '#/components/responses/GoalActionResponse' + 200: + $ref: '#/components/responses/GoalActionResponse' + 400: + description: Bad Request. + 403: + description: Unauthorized. + 404: + description: Not found. + 500: + description: Server Error. /goal/bind: post: @@ -6276,7 +6349,16 @@ paths: format: uuid description: Цели которые необходимо привязать responses: - $ref: '#/components/responses/GoalActionResponse' + 200: + $ref: '#/components/responses/GoalActionResponse' + 400: + description: Bad Request. + 403: + description: Unauthorized. + 404: + description: Not found. + 500: + description: Server Error. /goal/unbind: post: @@ -6298,7 +6380,16 @@ paths: type: string format: uuid responses: - $ref: '#/components/responses/GoalActionResponse' + 200: + $ref: '#/components/responses/GoalActionResponse' + 400: + description: Bad Request. + 403: + description: Unauthorized. + 404: + description: Not found. + 500: + description: Server Error. /goal-report/users: post: @@ -6448,7 +6539,7 @@ paths: content: application/json: schema: - $ref: '#/components/responses/GoalActionResponse' + $ref: '#/components/schemas/GoalActionResponse' 422: description: Bad Request 403: @@ -11432,7 +11523,7 @@ components: example: { "width": 1920, "height": 1080 - } + } properties: width: description: Image width. @@ -13830,6 +13921,28 @@ components: _meta: $ref: '#/components/schemas/_meta' + GoalActionResponse: + description: Goal object + type: object + properties: + success: + type: boolean + deleted: + type: array + items: + $ref: '#/components/schemas/GoalItem' + description: Цели которые были удалены + updated: + type: array + items: + $ref: '#/components/schemas/GoalItem' + description: Цели которые были обновлены + skipped: + type: array + items: + $ref: '#/components/schemas/GoalItem' + description: Цели которые не были обработаны + parameters: boardDateTypeParam: in: query @@ -13965,53 +14078,28 @@ components: responses: GoalIndexResponse: - 200: - description: Список целей - content: - application/json: - schema: - type: object - properties: - data: + description: Список целей + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: type: array items: - type: array - items: - $ref: '#/components/schemas/GoalItem' - _links: - $ref: '#/components/schemas/_links' - _meta: - $ref: '#/components/schemas/_meta' - 400: - description: Bad Request. - 403: - description: Unauthorized. - 404: - description: Not found. - 500: - description: Server Error. - + $ref: '#/components/schemas/GoalItem' + _links: + $ref: '#/components/schemas/_links' + _meta: + $ref: '#/components/schemas/_meta' GoalActionResponse: - description: Goal object - type: object - properties: - success: - type: boolean - deleted: - type: array - items: - $ref: '#/components/schemas/GoalItem' - description: Цели которые были удалены - updated: - type: array - items: - $ref: '#/components/schemas/GoalItem' - description: Цели которые были обновлены - skipped: - type: array - items: - $ref: '#/components/schemas/GoalItem' - description: Цели которые не были обработаны + description: Результат действия над целями + content: + application/json: + schema: + $ref: '#/components/schemas/GoalActionResponse' security: - SessionAuth: [ ]