From 27a9ec6e47ea7701757cc9e9b12da36a61f6af25 Mon Sep 17 00:00:00 2001 From: martmull Date: Thu, 14 Nov 2024 11:31:19 +0100 Subject: [PATCH] Fix open api specs for MULTI_SELECT --- .../core-modules/open-api/utils/components.utils.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/twenty-server/src/engine/core-modules/open-api/utils/components.utils.ts b/packages/twenty-server/src/engine/core-modules/open-api/utils/components.utils.ts index 07ad4770c7824..25d2390fb5ca0 100644 --- a/packages/twenty-server/src/engine/core-modules/open-api/utils/components.utils.ts +++ b/packages/twenty-server/src/engine/core-modules/open-api/utils/components.utils.ts @@ -115,8 +115,17 @@ const getSchemaComponentsProperties = ({ let itemProperty = {} as Property; switch (field.type) { - case FieldMetadataType.SELECT: case FieldMetadataType.MULTI_SELECT: + itemProperty = { + type: 'array', + items: { + enum: field.options.map( + (option: { value: string }) => option.value, + ), + }, + }; + break; + case FieldMetadataType.SELECT: itemProperty = { type: 'string', enum: field.options.map((option: { value: string }) => option.value),