diff --git a/packages/nocodb/src/lib/meta/api/swagger/helpers/getSwaggerColumnMetas.ts b/packages/nocodb/src/lib/meta/api/swagger/helpers/getSwaggerColumnMetas.ts index 09d3fabc3e..6ea1b312d6 100644 --- a/packages/nocodb/src/lib/meta/api/swagger/helpers/getSwaggerColumnMetas.ts +++ b/packages/nocodb/src/lib/meta/api/swagger/helpers/getSwaggerColumnMetas.ts @@ -40,6 +40,12 @@ export default async ( case UITypes.Rollup: field.type = 'number'; break; + case UITypes.Attachment: + field.type = 'array'; + field.items = { + $ref: `#/components/schemas/Attachment`, + }; + break; default: field.virtual = false; SwaggerTypes.setSwaggerType(c, field, dbType); @@ -58,4 +64,5 @@ export interface SwaggerColumn { virtual?: boolean; $ref?: any; column: Column; + items?: any; } diff --git a/packages/nocodb/src/lib/meta/api/swagger/helpers/swagger-base.json b/packages/nocodb/src/lib/meta/api/swagger/helpers/swagger-base.json index 7e881e8fe2..b7096249f8 100644 --- a/packages/nocodb/src/lib/meta/api/swagger/helpers/swagger-base.json +++ b/packages/nocodb/src/lib/meta/api/swagger/helpers/swagger-base.json @@ -34,6 +34,27 @@ } } }, + "Attachment": { + "title": "Attachment", + "type": "object", + "properties": { + "mimetype": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + }, + "icon": { + "type": "string" + } + } + }, "Groupby": { "title": "Groupby", "type": "object",