From ddbfabfc99343e4f7939e7d6e399171c32342331 Mon Sep 17 00:00:00 2001 From: martmull Date: Thu, 17 Oct 2024 14:41:38 +0200 Subject: [PATCH] Precise wording for api example (#7783) Enhance composite type filter example in open-api --- .../open-api/utils/__tests__/parameters.utils.spec.ts | 4 ++-- .../engine/core-modules/open-api/utils/parameters.utils.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/twenty-server/src/engine/core-modules/open-api/utils/__tests__/parameters.utils.spec.ts b/packages/twenty-server/src/engine/core-modules/open-api/utils/__tests__/parameters.utils.spec.ts index bab186af5231..6d5ab0751d5a 100644 --- a/packages/twenty-server/src/engine/core-modules/open-api/utils/__tests__/parameters.utils.spec.ts +++ b/packages/twenty-server/src/engine/core-modules/open-api/utils/__tests__/parameters.utils.spec.ts @@ -84,7 +84,7 @@ describe('computeParameters', () => { in: 'query', description: `Filters objects returned. Should have the following shape: **field_1[COMPARATOR]:value_1,field_2[COMPARATOR]:value_2... - To filter on nested objects use **field.nestedField[COMPARATOR]:value_1 + To filter on composite type fields use **field.subField[COMPARATOR]:value_1 ** Available comparators are **${Object.values(FilterComparators).join( '**, **', @@ -106,7 +106,7 @@ describe('computeParameters', () => { }, simpleNested: { value: 'emails.primaryEmail[eq]:foo99@example.com', - description: 'A simple nested filter param', + description: 'A simple composite type filter param', }, complex: { value: diff --git a/packages/twenty-server/src/engine/core-modules/open-api/utils/parameters.utils.ts b/packages/twenty-server/src/engine/core-modules/open-api/utils/parameters.utils.ts index f16c6fe436b9..26679a18fc34 100644 --- a/packages/twenty-server/src/engine/core-modules/open-api/utils/parameters.utils.ts +++ b/packages/twenty-server/src/engine/core-modules/open-api/utils/parameters.utils.ts @@ -74,7 +74,7 @@ export const computeFilterParameters = (): OpenAPIV3_1.ParameterObject => { in: 'query', description: `Filters objects returned. Should have the following shape: **field_1[COMPARATOR]:value_1,field_2[COMPARATOR]:value_2... - To filter on nested objects use **field.nestedField[COMPARATOR]:value_1 + To filter on composite type fields use **field.subField[COMPARATOR]:value_1 ** Available comparators are **${Object.values(FilterComparators).join( '**, **', @@ -97,7 +97,7 @@ export const computeFilterParameters = (): OpenAPIV3_1.ParameterObject => { }, simpleNested: { value: 'emails.primaryEmail[eq]:foo99@example.com', - description: 'A simple nested filter param', + description: 'A simple composite type filter param', }, complex: { value: