feat: file upload imlemented
This commit is contained in:
parent
7623adf2a7
commit
184868b142
7 changed files with 355 additions and 8 deletions
37
api/paths/media_upload.yaml
Normal file
37
api/paths/media_upload.yaml
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue