feat: file upload imlemented
All checks were successful
Build and Deploy Go App / build (push) Successful in 9m4s
Build and Deploy Go App / deploy (push) Successful in 41s

This commit is contained in:
Iron_Felix 2025-12-06 04:13:27 +03:00
parent 7623adf2a7
commit 184868b142
7 changed files with 355 additions and 8 deletions

View file

@ -0,0 +1,37 @@
post:
summary: Upload an image (PNG, JPEG, or WebP)
description: |
Uploads a single image file. Supported formats: **PNG**, **JPEG/JPG**, **WebP**.
requestBody:
required: true
content:
multipart/form-data:
schema:
image:
type: string
format: binary
description: Image file (PNG, JPEG, or WebP)
encoding:
image:
contentType: image/png, image/jpeg, image/webp
responses:
'200':
description: Image uploaded successfully
content:
application/json:
schema:
$ref: "../schemas/Image.yaml"
'400':
description: Bad request — e.g., invalid/malformed image, empty file
content:
application/json:
schema:
type: string
'415':
description: |
Unsupported Media Type — e.g., request `Content-Type` is not `multipart/form-data`,
or the `image` part has an unsupported `Content-Type` (not image/png, image/jpeg, or image/webp)
'500':
description: Internal server error