diff --git a/packages/nocodb/src/lib/models/LookupColumn.ts b/packages/nocodb/src/lib/models/LookupColumn.ts index 91c51e9a67..2a19fe7a68 100644 --- a/packages/nocodb/src/lib/models/LookupColumn.ts +++ b/packages/nocodb/src/lib/models/LookupColumn.ts @@ -3,8 +3,9 @@ import Column from './Column'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import NocoCache from '../cache/NocoCache'; import { extractProps } from '../meta/helpers/extractProps'; +import type { LookupType } from 'nocodb-sdk'; -export default class LookupColumn { +export default class LookupColumn implements LookupType { fk_relation_column_id: string; fk_lookup_column_id: string; fk_column_id: string; diff --git a/packages/nocodb/src/schema/swagger.json b/packages/nocodb/src/schema/swagger.json index 72ab9c8a4a..08a46a87ff 100644 --- a/packages/nocodb/src/schema/swagger.json +++ b/packages/nocodb/src/schema/swagger.json @@ -10332,54 +10332,46 @@ "description": "Model for Lookup", "examples": [ { - "deleted": "string", - "fk_column_id": "string", - "fk_lookup_column_id": "string", - "fk_relation_column_id": "string", - "id": "string", - "order": "string", - "type": "string", - "virtual": true + "id": "lk_mngsu0e45njbxr", + "fk_column_id": "cl_vdiy9bz7h11kdm", + "fk_relation_column_id": "cl_5jestblzneb649", + "fk_lookup_column_id": "cl_4cm47dtjphgqkv", + "order": 1 } ], + "title": "Lookup Model", + "type": "object", "properties": { - "deleted": { - "type": "string" + "id": { + "$ref": "#/components/schemas/Id", + "description": "Unique ID" }, "fk_column_id": { "$ref": "#/components/schemas/Id", "description": "Foreign Key to Column" }, "fk_lookup_column_id": { - "type": "string" + "$ref": "#/components/schemas/Id", + "description": "Foreign Key to Lookup Column" }, "fk_relation_column_id": { - "type": "string" - }, - "id": { "$ref": "#/components/schemas/Id", - "description": "Unique ID" + "description": "Foreign Key to Relation Column" }, "order": { - "type": "string" - }, - "type": { - "type": "string" - }, - "virtual": { - "$ref": "#/components/schemas/Bool" + "type": "number", + "description": "The order among the list", + "example": 1 } - }, - "title": "Lookup Model", - "type": "object" + } }, "LookupColumnReq": { "description": "Model for Lookup Column Request", "examples": [ { - "fk_lookup_column_id": "string", - "fk_relation_column_id": "string", - "title": "string", + "fk_relation_column_id": "cl_5jestblzneb649", + "fk_lookup_column_id": "cl_4cm47dtjphgqkv", + "title": "My Lookup", "uidt": "Lookup" } ], @@ -10387,18 +10379,23 @@ "type": "object", "properties": { "fk_lookup_column_id": { - "$ref": "#/components/schemas/Id" + "$ref": "#/components/schemas/Id", + "description": "Foreign Key to Lookup Column" }, "fk_relation_column_id": { - "$ref": "#/components/schemas/Id" + "$ref": "#/components/schemas/Id", + "description": "Foreign Key to Relation Column" }, "title": { "maxLength": 255, - "type": "string" + "type": "string", + "description": "Lookup Title", + "example": "My Lookup" }, "uidt": { "enum": ["Lookup"], - "type": "string" + "type": "string", + "description": "UI DataType" } } },