Browse Source

refactor(nocodb): attachment models in swagger.json

pull/5222/head
Wing-Kam Wong 2 years ago
parent
commit
76cdd7b035
  1. 112
      packages/nocodb/src/schema/swagger.json

112
packages/nocodb/src/schema/swagger.json

@ -7406,11 +7406,15 @@
"content": { "content": {
"multipart/form-data": { "multipart/form-data": {
"schema": { "schema": {
"type": "object", "$ref": "#/components/schemas/AttachmentReq"
"properties": { },
"files": {}, "examples": {
"json": { "Example 1": {
"type": "string" "value": {
"mimetype": "image/jpeg",
"path": "download/noco/jango_fett/Table1/attachment/uVbjPVQxC_SSfs8Ctx.jpg",
"size": 13052,
"title": "22bc-kavypmq4869759 (1).jpg"
} }
} }
} }
@ -7421,11 +7425,13 @@
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
"type": "string" "type": "string",
"example": "download/noco/jango_fett/Table1/attachment/uVbjPVQxC_SSfs8Ctx.jpg"
}, },
"name": "path", "name": "path",
"in": "query", "in": "query",
"required": true "required": true,
"description": "Target File Path"
} }
], ],
"description": "Upload attachment" "description": "Upload attachment"
@ -7443,33 +7449,22 @@
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
"type": "object", "$ref": "#/components/schemas/AttachmentReq"
"properties": {
"url": {
"type": "string"
},
"fileName": {
"type": "string"
},
"mimetype": {
"type": "string"
},
"size": {
"type": "string"
}
}
} }
} },
"examples": {}
} }
} }
}, },
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
"type": "string" "type": "string",
"example": "download/noco/jango_fett/Table1/attachment/c7z_UF8sZBgJUxMjpN.jpg"
}, },
"name": "path", "name": "path",
"in": "query", "in": "query",
"description": "Target File Path",
"required": true "required": true
} }
], ],
@ -7576,37 +7571,74 @@
"examples": [ "examples": [
{ {
"data": null, "data": null,
"icon": "string", "mimetype": "image/jpeg",
"mimetype": "string", "path": "download/noco/jango_fett/Table1/attachment/c7z_UF8sZBgJUxMjpN.jpg",
"path": "string", "size": 12345,
"size": "string", "title": "kavypmq4869759.jpg"
"title": "string",
"url": "string"
} }
], ],
"title": "Attachment Model",
"type": "object",
"properties": { "properties": {
"data": {}, "data": {
"icon": { "description": "Data for uploading"
"type": "string"
}, },
"mimetype": { "mimetype": {
"type": "string" "type": "string",
"description": "The mimetype of the attachment"
}, },
"path": { "path": {
"type": "string" "type": "string",
"description": "File Path"
}, },
"size": { "size": {
"type": "string" "type": "number",
"description": "Attachment Size"
}, },
"title": { "title": {
"type": "string" "type": "string",
"description": "The title of the attachment. Used in UI."
}, },
"url": { "url": {
"type": "string" "type": "string",
"description": "Attachment URL"
}
}
},
"AttachmentReq": {
"description": "Model for Attachment Request",
"type": "object",
"x-examples": {
"Example 1": {
"mimetype": "image/jpeg",
"path": "download/noco/jango_fett/Table1/attachment/uVbjPVQxC_SSfs8Ctx.jpg",
"size": 13052,
"title": "22bc-kavypmq4869759 (1).jpg"
} }
}, },
"title": "Attachment Model", "title": "Attachment Request Model",
"type": "object" "properties": {
"mimetype": {
"type": "string",
"description": "The mimetype of the attachment"
},
"path": {
"type": "string",
"description": "The file path of the attachment"
},
"size": {
"type": "number",
"description": "The size of the attachment"
},
"title": {
"type": "string",
"description": "The title of the attachment used in UI"
},
"url": {
"type": "string",
"description": "Attachment URL to be uploaded via upload-by-url"
}
}
}, },
"Audit": { "Audit": {
"description": "Model for Audit", "description": "Model for Audit",

Loading…
Cancel
Save