Image Endpoint
This commit is contained in:
+63
-1
@@ -491,7 +491,7 @@ paths:
|
||||
$ref: "#/components/schemas/NotFoundResponse"
|
||||
examples:
|
||||
User not found:
|
||||
value: { "code": "NotFound", "entity": "username" }
|
||||
value: { "code": "NotFound", "entity": "user" }
|
||||
500:
|
||||
description: Update failed.
|
||||
content:
|
||||
@@ -539,6 +539,60 @@ paths:
|
||||
value: { "code": "NotFound", "entity": "user" }
|
||||
tags:
|
||||
- User
|
||||
/users/{id}/image:
|
||||
post:
|
||||
summary: Update user image
|
||||
description: Update user image with ID. <br>
|
||||
Use special ID <code>self</code> to update logged in user. <br>
|
||||
Requires logged in user to have admin permissions for any ID other than <code>self</code>.
|
||||
security:
|
||||
- BasicAuth: []
|
||||
- BasicAuth: [isAdmin]
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
description: User ID
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int14
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/UserImageUpdateRequest"
|
||||
responses:
|
||||
200:
|
||||
description: Success.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/UserResponse"
|
||||
404:
|
||||
description: User not found.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/NotFoundResponse"
|
||||
examples:
|
||||
User not found:
|
||||
value: { "code": "NotFound", "entity": "user" }
|
||||
500:
|
||||
description: Update failed.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FailedUpdateResponse"
|
||||
examples:
|
||||
Failed username:
|
||||
value:
|
||||
{
|
||||
"code": "FailedUpdate",
|
||||
"fields": ["image", "predefined"],
|
||||
"reasons": ["string", "string"],
|
||||
}
|
||||
tags:
|
||||
- User
|
||||
|
||||
externalDocs:
|
||||
url: https://khofmann.userpage.fu-berlin.de/phpCourse/exam/api/docs/
|
||||
@@ -658,6 +712,14 @@ components:
|
||||
type: string
|
||||
email:
|
||||
type: string
|
||||
UserImageUpdateRequest:
|
||||
type: object
|
||||
properties:
|
||||
image:
|
||||
type: string
|
||||
format: binary
|
||||
predefined:
|
||||
type: string
|
||||
RegisterRequest:
|
||||
type: object
|
||||
required:
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user