improve the documentation on api upload method

This commit is contained in:
blek 2023-12-13 00:47:47 +10:00
parent 616ceb2ad7
commit 7e9d387cc2
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 27 additions and 2 deletions

View File

@ -102,6 +102,8 @@ paths:
security: security:
- apikey: [ key ] - apikey: [ key ]
requestBody: requestBody:
description: |-
A multipart form
content: content:
multipart/form-data: multipart/form-data:
schema: schema:
@ -117,7 +119,18 @@ paths:
description: Instance-specific password needed to upload files description: Instance-specific password needed to upload files
metadata: metadata:
type: object type: object
description: file info description: |-
JSON object with file info:
```
{
sha512: string,
name?: string,
pass?: string
}
```
Note that the content type does not matter on this one.
properties: properties:
sha512: sha512:
type: string type: string
@ -140,7 +153,7 @@ paths:
example: 'OK' example: 'OK'
401: 401:
description: |- description: |-
This error code is returned if one of the two conditions are met: This error code is returned if one of the 4 conditions are met:
1. The instance does not allow API file uploads. 1. The instance does not allow API file uploads.
2. The instance requires API key for all API manipulations. 2. The instance requires API key for all API manipulations.
@ -155,6 +168,18 @@ paths:
example: 'APIPasswordDenied' example: 'APIPasswordDenied'
details: details:
example: 'API password authorization has been denied.' example: 'API password authorization has been denied.'
403:
description: |-
This error code is returned if your request payload is malformed or the hash doesn't match the file
content:
application/json:
schema:
type: object
properties:
error:
example: 'APIError'
details:
example: 'Request payload invalid'
components: components: