Browse Source

fix(swagger): update attachment column type

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4513/head
Pranav C 2 years ago
parent
commit
953716cf4b
  1. 7
      packages/nocodb/src/lib/meta/api/swagger/helpers/getSwaggerColumnMetas.ts
  2. 21
      packages/nocodb/src/lib/meta/api/swagger/helpers/swagger-base.json

7
packages/nocodb/src/lib/meta/api/swagger/helpers/getSwaggerColumnMetas.ts

@ -40,6 +40,12 @@ export default async (
case UITypes.Rollup: case UITypes.Rollup:
field.type = 'number'; field.type = 'number';
break; break;
case UITypes.Attachment:
field.type = 'array';
field.items = {
$ref: `#/components/schemas/Attachment`,
};
break;
default: default:
field.virtual = false; field.virtual = false;
SwaggerTypes.setSwaggerType(c, field, dbType); SwaggerTypes.setSwaggerType(c, field, dbType);
@ -58,4 +64,5 @@ export interface SwaggerColumn {
virtual?: boolean; virtual?: boolean;
$ref?: any; $ref?: any;
column: Column; column: Column;
items?: any;
} }

21
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": { "Groupby": {
"title": "Groupby", "title": "Groupby",
"type": "object", "type": "object",

Loading…
Cancel
Save