280 lines
6.8 KiB
JSON
Raw Normal View History

{
"paths": {
2023-03-15 13:25:17 +01:00
"/upload": {
2018-09-20 11:40:37 +02:00
"post": {
2023-03-15 13:25:17 +01:00
"description": "Upload files",
2018-09-20 11:40:37 +02:00
"responses": {
"200": {
"description": "response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
2023-03-15 13:25:17 +01:00
"$ref": "#/components/schemas/UploadFile"
2018-09-20 11:40:37 +02:00
}
}
}
}
}
},
"summary": "",
"tags": [
"Upload - File"
],
"requestBody": {
2023-03-15 13:25:17 +01:00
"description": "Upload files",
2018-09-20 11:40:37 +02:00
"required": true,
"content": {
"multipart/form-data": {
"schema": {
2023-03-15 13:25:17 +01:00
"required": [
"files"
],
"type": "object",
2018-09-20 11:40:37 +02:00
"properties": {
"path": {
"type": "string",
2023-03-15 13:25:17 +01:00
"description": "The folder where the file(s) will be uploaded to (only supported on strapi-provider-upload-aws-s3)."
2018-09-20 11:40:37 +02:00
},
"refId": {
"type": "string",
2023-03-15 13:25:17 +01:00
"description": "The ID of the entry which the file(s) will be linked to"
2018-09-20 11:40:37 +02:00
},
"ref": {
"type": "string",
2023-03-15 13:25:17 +01:00
"description": "The unique ID (uid) of the model which the file(s) will be linked to (api::restaurant.restaurant)."
2018-09-20 11:40:37 +02:00
},
"field": {
"type": "string",
2023-03-15 13:25:17 +01:00
"description": "The field of the entry which the file(s) will be precisely linked to."
},
"files": {
"type": "array",
"items": {
"type": "string",
"format": "binary"
}
2018-09-20 11:40:37 +02:00
}
}
}
}
}
}
}
},
2023-03-15 13:25:17 +01:00
"/upload?id={id}": {
"post": {
"parameters": [
{
"name": "id",
"in": "query",
"description": "File id",
"required": true,
"schema": {
"type": "string"
}
}
2023-03-15 13:25:17 +01:00
],
"description": "Upload file information",
"responses": {
"200": {
2023-03-15 13:25:17 +01:00
"description": "response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UploadFile"
}
}
}
}
}
2023-03-15 13:25:17 +01:00
},
"summary": "",
"tags": [
"Upload - File"
],
"requestBody": {
"description": "Upload files",
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"fileInfo": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"alternativeText": {
"type": "string"
},
"caption": {
"type": "string"
}
}
},
"files": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
}
},
2023-03-15 13:25:17 +01:00
"/upload/files": {
"get": {
2023-03-15 13:25:17 +01:00
"tags": [
"Upload - File"
],
"responses": {
"200": {
2023-03-15 13:25:17 +01:00
"description": "Get a list of files",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UploadFile"
}
}
}
}
}
}
}
},
2023-03-15 13:25:17 +01:00
"/upload/files/{id}": {
"get": {
"parameters": [
{
2023-03-15 13:25:17 +01:00
"name": "id",
"in": "path",
"description": "",
"deprecated": false,
"required": true,
"schema": {
"type": "string"
}
}
],
2023-03-15 13:25:17 +01:00
"tags": [
"Upload - File"
],
"responses": {
"200": {
2023-03-15 13:25:17 +01:00
"description": "Get a specific file",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadFile"
}
}
}
}
}
},
"delete": {
"parameters": [
{
2023-03-15 13:25:17 +01:00
"name": "id",
"in": "path",
"description": "",
"deprecated": false,
"required": true,
"schema": {
"type": "string"
}
}
],
2023-03-15 13:25:17 +01:00
"tags": [
"Upload - File"
],
"responses": {
"200": {
2023-03-15 13:25:17 +01:00
"description": "Delete a file",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadFile"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"UploadFile": {
"properties": {
2023-03-15 13:25:17 +01:00
"id": {
"type": "number"
},
"name": {
"type": "string"
},
2023-03-15 13:25:17 +01:00
"alternativeText": {
"type": "string"
},
"caption": {
"type": "string"
},
2023-03-15 13:25:17 +01:00
"width": {
"type": "number",
"format": "integer"
},
"height": {
"type": "number",
"format": "integer"
},
"formats": {
"type": "number"
},
"hash": {
"type": "string"
},
"ext": {
"type": "string"
},
"mime": {
"type": "string"
},
2023-03-15 13:25:17 +01:00
"size": {
"type": "number",
"format": "double"
},
"url": {
"type": "string"
},
2023-03-15 13:25:17 +01:00
"previewUrl": {
"type": "string"
},
2023-03-15 13:25:17 +01:00
"provider": {
"type": "string"
},
2023-03-15 13:25:17 +01:00
"provider_metadata": {
"type": "object"
},
"createdAt": {
2023-03-15 13:25:17 +01:00
"type": "string",
"format": "date-time"
},
2023-03-15 13:25:17 +01:00
"updatedAt": {
"type": "string",
"format": "date-time"
}
}
}
}
}
2023-03-24 16:39:19 +01:00
}