feat: file upload imlemented
This commit is contained in:
parent
7623adf2a7
commit
184868b142
7 changed files with 355 additions and 8 deletions
|
|
@ -527,6 +527,42 @@ paths:
|
|||
description: Internal server error
|
||||
security:
|
||||
- XsrfAuthHeader: []
|
||||
/media/upload:
|
||||
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:
|
||||
encoding:
|
||||
image:
|
||||
contentType: 'image/png, image/jpeg, image/webp'
|
||||
multipart/form-data:
|
||||
schema:
|
||||
image:
|
||||
type: string
|
||||
format: binary
|
||||
description: 'Image file (PNG, JPEG, or WebP)'
|
||||
responses:
|
||||
'200':
|
||||
description: Image uploaded successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Image'
|
||||
'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
|
||||
components:
|
||||
parameters:
|
||||
cursor:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue