From d330f61dfd2c024d501f648b0d9f9c8ba8c2d0a8 Mon Sep 17 00:00:00 2001 From: brendanlaschke Date: Wed, 14 Feb 2024 15:35:25 +0100 Subject: [PATCH] - include field description --- .../src/core/open-api/utils/components.utils.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/twenty-server/src/core/open-api/utils/components.utils.ts b/packages/twenty-server/src/core/open-api/utils/components.utils.ts index e02f6520774b..afe890c70b59 100644 --- a/packages/twenty-server/src/core/open-api/utils/components.utils.ts +++ b/packages/twenty-server/src/core/open-api/utils/components.utils.ts @@ -73,6 +73,10 @@ const getSchemaComponentsProperties = ( break; } + if (field.description) { + itemProperty.description = field.description; + } + if (Object.keys(itemProperty).length) { node[field.name] = itemProperty; } @@ -98,6 +102,7 @@ const computeSchemaComponent = ( ): OpenAPIV3.SchemaObject => { const result = { type: 'object', + description: item.description, properties: getSchemaComponentsProperties(item), example: {}, } as OpenAPIV3.SchemaObject;