swagger docs update

This commit is contained in:
nquidox 2025-10-26 19:54:51 +03:00
parent f13012b742
commit 37a1dfbf52
3 changed files with 52 additions and 47 deletions

View file

@ -192,7 +192,7 @@ const docTemplate = `{
"BearerAuth": [] "BearerAuth": []
} }
], ],
"description": "Загрузить картинки по merch_uuid и query параметрам", "description": "Загрузить картинку по merch_uuid. В ответ будут выданы ссылки на созданные картинки.",
"consumes": [ "consumes": [
"multipart/form-data" "multipart/form-data"
], ],
@ -202,7 +202,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Merch images" "Merch images"
], ],
"summary": "Загрузить картинки по merch_uuid и query параметрам", "summary": "Загрузить картинку по merch_uuid",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -217,23 +217,14 @@ const docTemplate = `{
"name": "file", "name": "file",
"in": "formData", "in": "formData",
"required": true "required": true
},
{
"enum": [
"thumbnail",
"full",
"all"
],
"type": "string",
"description": "Image type: thumbnail, full or all",
"name": "imageType",
"in": "formData",
"required": true
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "OK" "description": "OK",
"schema": {
"$ref": "#/definitions/imageStorage.UploadMerchImageResponse"
}
}, },
"400": { "400": {
"description": "Bad Request", "description": "Bad Request",
@ -255,11 +246,11 @@ const docTemplate = `{
"BearerAuth": [] "BearerAuth": []
} }
], ],
"description": "Удалить (безвозвратно) картинки по merch_uuid и query параметрам", "description": "Удалить (безвозвратно) картинки по merch_uuid",
"tags": [ "tags": [
"Merch images" "Merch images"
], ],
"summary": "Удалить (безвозвратно) картинки по merch_uuid и query параметрам", "summary": "Удалить (безвозвратно) картинки по merch_uuid",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -768,6 +759,17 @@ const docTemplate = `{
} }
}, },
"definitions": { "definitions": {
"imageStorage.UploadMerchImageResponse": {
"type": "object",
"properties": {
"fullImage": {
"type": "string"
},
"thumbnail": {
"type": "string"
}
}
},
"merch.ImageLink": { "merch.ImageLink": {
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -184,7 +184,7 @@
"BearerAuth": [] "BearerAuth": []
} }
], ],
"description": "Загрузить картинки по merch_uuid и query параметрам", "description": "Загрузить картинку по merch_uuid. В ответ будут выданы ссылки на созданные картинки.",
"consumes": [ "consumes": [
"multipart/form-data" "multipart/form-data"
], ],
@ -194,7 +194,7 @@
"tags": [ "tags": [
"Merch images" "Merch images"
], ],
"summary": "Загрузить картинки по merch_uuid и query параметрам", "summary": "Загрузить картинку по merch_uuid",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -209,23 +209,14 @@
"name": "file", "name": "file",
"in": "formData", "in": "formData",
"required": true "required": true
},
{
"enum": [
"thumbnail",
"full",
"all"
],
"type": "string",
"description": "Image type: thumbnail, full or all",
"name": "imageType",
"in": "formData",
"required": true
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "OK" "description": "OK",
"schema": {
"$ref": "#/definitions/imageStorage.UploadMerchImageResponse"
}
}, },
"400": { "400": {
"description": "Bad Request", "description": "Bad Request",
@ -247,11 +238,11 @@
"BearerAuth": [] "BearerAuth": []
} }
], ],
"description": "Удалить (безвозвратно) картинки по merch_uuid и query параметрам", "description": "Удалить (безвозвратно) картинки по merch_uuid",
"tags": [ "tags": [
"Merch images" "Merch images"
], ],
"summary": "Удалить (безвозвратно) картинки по merch_uuid и query параметрам", "summary": "Удалить (безвозвратно) картинки по merch_uuid",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -760,6 +751,17 @@
} }
}, },
"definitions": { "definitions": {
"imageStorage.UploadMerchImageResponse": {
"type": "object",
"properties": {
"fullImage": {
"type": "string"
},
"thumbnail": {
"type": "string"
}
}
},
"merch.ImageLink": { "merch.ImageLink": {
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -1,5 +1,12 @@
basePath: /api/v2 basePath: /api/v2
definitions: definitions:
imageStorage.UploadMerchImageResponse:
properties:
fullImage:
type: string
thumbnail:
type: string
type: object
merch.ImageLink: merch.ImageLink:
properties: properties:
etag: etag:
@ -271,7 +278,7 @@ paths:
- Merch - Merch
/merch/images/{uuid}: /merch/images/{uuid}:
delete: delete:
description: Удалить (безвозвратно) картинки по merch_uuid и query параметрам description: Удалить (безвозвратно) картинки по merch_uuid
parameters: parameters:
- description: merch_uuid - description: merch_uuid
in: path in: path
@ -291,7 +298,7 @@ paths:
$ref: '#/definitions/responses.ErrorResponse500' $ref: '#/definitions/responses.ErrorResponse500'
security: security:
- BearerAuth: [] - BearerAuth: []
summary: Удалить (безвозвратно) картинки по merch_uuid и query параметрам summary: Удалить (безвозвратно) картинки по merch_uuid
tags: tags:
- Merch images - Merch images
get: get:
@ -328,7 +335,8 @@ paths:
post: post:
consumes: consumes:
- multipart/form-data - multipart/form-data
description: Загрузить картинки по merch_uuid и query параметрам description: Загрузить картинку по merch_uuid. В ответ будут выданы ссылки на
созданные картинки.
parameters: parameters:
- description: Merch UUID - description: Merch UUID
in: path in: path
@ -340,20 +348,13 @@ paths:
name: file name: file
required: true required: true
type: file type: file
- description: 'Image type: thumbnail, full or all'
enum:
- thumbnail
- full
- all
in: formData
name: imageType
required: true
type: string
produces: produces:
- application/json - application/json
responses: responses:
"200": "200":
description: OK description: OK
schema:
$ref: '#/definitions/imageStorage.UploadMerchImageResponse'
"400": "400":
description: Bad Request description: Bad Request
schema: schema:
@ -364,7 +365,7 @@ paths:
$ref: '#/definitions/responses.ErrorResponse500' $ref: '#/definitions/responses.ErrorResponse500'
security: security:
- BearerAuth: [] - BearerAuth: []
summary: Загрузить картинки по merch_uuid и query параметрам summary: Загрузить картинку по merch_uuid
tags: tags:
- Merch images - Merch images
/prices: /prices: