swagger docs update

This commit is contained in:
nquidox 2026-03-07 15:50:05 +03:00
parent 71d13bb217
commit cfccb19666
3 changed files with 381 additions and 6 deletions

View file

@ -61,6 +61,65 @@ const docTemplate = `{
} }
} }
}, },
"/merch/extra/{uuid}": {
"put": {
"description": "Update ONLY merch extra data",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Merch"
],
"summary": "Update merch extra data",
"parameters": [
{
"type": "string",
"description": "merch uuid",
"name": "uuid",
"in": "path",
"required": true
},
{
"description": "payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/merch.extraDataDTO"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/merch.extraDataDTO"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/responses.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
}
},
"/merch/list": { "/merch/list": {
"get": { "get": {
"description": "Get all merch without origins", "description": "Get all merch without origins",
@ -235,6 +294,63 @@ const docTemplate = `{
} }
}, },
"/merch/{uuid}": { "/merch/{uuid}": {
"put": {
"description": "Update merch general info (except extra data)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Merch"
],
"summary": "Update merch",
"parameters": [
{
"type": "string",
"description": "merch uuid",
"name": "uuid",
"in": "path",
"required": true
},
{
"description": "payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/merch.updateMerchDTO"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/merch.merchDTO"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/responses.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
},
"delete": { "delete": {
"description": "Marks merch and all its extra data as deleted by uuid.", "description": "Marks merch and all its extra data as deleted by uuid.",
"consumes": [ "consumes": [
@ -288,6 +404,20 @@ const docTemplate = `{
} }
} }
}, },
"merch.extraDataDTO": {
"type": "object",
"properties": {
"links": {
"type": "array",
"items": {
"$ref": "#/definitions/merch.originLink"
}
},
"merch_uuid": {
"type": "string"
}
}
},
"merch.merchDTO": { "merch.merchDTO": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -341,10 +471,10 @@ const docTemplate = `{
"merch.originLink": { "merch.originLink": {
"type": "object", "type": "object",
"properties": { "properties": {
"origin_link": { "origin": {
"type": "string" "type": "string"
}, },
"origin_name": { "origin_link": {
"type": "string" "type": "string"
} }
} }
@ -360,6 +490,17 @@ const docTemplate = `{
} }
} }
}, },
"merch.updateMerchDTO": {
"type": "object",
"properties": {
"merch_uuid": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"responses.BadRequest": { "responses.BadRequest": {
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -54,6 +54,65 @@
} }
} }
}, },
"/merch/extra/{uuid}": {
"put": {
"description": "Update ONLY merch extra data",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Merch"
],
"summary": "Update merch extra data",
"parameters": [
{
"type": "string",
"description": "merch uuid",
"name": "uuid",
"in": "path",
"required": true
},
{
"description": "payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/merch.extraDataDTO"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/merch.extraDataDTO"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/responses.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
}
},
"/merch/list": { "/merch/list": {
"get": { "get": {
"description": "Get all merch without origins", "description": "Get all merch without origins",
@ -228,6 +287,63 @@
} }
}, },
"/merch/{uuid}": { "/merch/{uuid}": {
"put": {
"description": "Update merch general info (except extra data)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Merch"
],
"summary": "Update merch",
"parameters": [
{
"type": "string",
"description": "merch uuid",
"name": "uuid",
"in": "path",
"required": true
},
{
"description": "payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/merch.updateMerchDTO"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/merch.merchDTO"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/responses.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
},
"delete": { "delete": {
"description": "Marks merch and all its extra data as deleted by uuid.", "description": "Marks merch and all its extra data as deleted by uuid.",
"consumes": [ "consumes": [
@ -281,6 +397,20 @@
} }
} }
}, },
"merch.extraDataDTO": {
"type": "object",
"properties": {
"links": {
"type": "array",
"items": {
"$ref": "#/definitions/merch.originLink"
}
},
"merch_uuid": {
"type": "string"
}
}
},
"merch.merchDTO": { "merch.merchDTO": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -334,10 +464,10 @@
"merch.originLink": { "merch.originLink": {
"type": "object", "type": "object",
"properties": { "properties": {
"origin_link": { "origin": {
"type": "string" "type": "string"
}, },
"origin_name": { "origin_link": {
"type": "string" "type": "string"
} }
} }
@ -353,6 +483,17 @@
} }
} }
}, },
"merch.updateMerchDTO": {
"type": "object",
"properties": {
"merch_uuid": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"responses.BadRequest": { "responses.BadRequest": {
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -5,6 +5,15 @@ definitions:
name: name:
type: string type: string
type: object type: object
merch.extraDataDTO:
properties:
links:
items:
$ref: '#/definitions/merch.originLink'
type: array
merch_uuid:
type: string
type: object
merch.merchDTO: merch.merchDTO:
properties: properties:
created_at: created_at:
@ -39,9 +48,9 @@ definitions:
type: object type: object
merch.originLink: merch.originLink:
properties: properties:
origin_link: origin:
type: string type: string
origin_name: origin_link:
type: string type: string
type: object type: object
merch.originsDTO: merch.originsDTO:
@ -51,6 +60,13 @@ definitions:
$ref: '#/definitions/merch.originItem' $ref: '#/definitions/merch.originItem'
type: array type: array
type: object type: object
merch.updateMerchDTO:
properties:
merch_uuid:
type: string
name:
type: string
type: object
responses.BadRequest: responses.BadRequest:
properties: properties:
error: error:
@ -104,6 +120,44 @@ paths:
summary: Delete merch summary: Delete merch
tags: tags:
- Merch - Merch
put:
consumes:
- application/json
description: Update merch general info (except extra data)
parameters:
- description: merch uuid
in: path
name: uuid
required: true
type: string
- description: payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/merch.updateMerchDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/merch.merchDTO'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Update merch
tags:
- Merch
/merch/create: /merch/create:
post: post:
consumes: consumes:
@ -134,6 +188,45 @@ paths:
summary: Create new merch summary: Create new merch
tags: tags:
- Merch - Merch
/merch/extra/{uuid}:
put:
consumes:
- application/json
description: Update ONLY merch extra data
parameters:
- description: merch uuid
in: path
name: uuid
required: true
type: string
- description: payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/merch.extraDataDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/merch.extraDataDTO'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Update merch extra data
tags:
- Merch
/merch/list: /merch/list:
get: get:
description: Get all merch without origins description: Get all merch without origins