From 74a676aa8f56a201c9661e5a84163bfee4e500fc Mon Sep 17 00:00:00 2001 From: Sonarly Claude Code Date: Thu, 23 Apr 2026 09:53:22 +0000 Subject: [PATCH] fix(open-api): remove incorrect uuid format from pageInfo cursor fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://sonarly.com/issue/30216?type=bug The OpenAPI specification for all list endpoints incorrectly declares `startCursor` and `endCursor` in `pageInfo` as `format: 'uuid'`, but the actual API returns base64-encoded JSON strings. This causes client code generators and validation tools to reject valid API responses. Fix: Removed the incorrect `format: 'uuid'` annotation from `startCursor` and `endCursor` fields in the OpenAPI response schema definitions. The fix touches two functions in `responses.utils.ts`: 1. **`getFindManyResponse200`** (line 35-42): Changed cursor fields from `{ type: 'string', format: 'uuid' }` to `{ type: 'string' }`. This affects the OpenAPI spec for all list/findMany endpoints. 2. **`getFindDuplicatesResponse200`** (line 417-424): Same change for the findDuplicates endpoint response schema. The actual API returns base64-encoded JSON cursors (e.g., `eyJpZCI6IjQ4MTQ4MjhhLWM3ZWEtNGVhZi04YmIxLThhODg2NmI0MWY4MiJ9`), not UUIDs. The `format: 'uuid'` was incorrectly added in commit c55dfbde6e3 during an OpenAPI cleanup — likely because the cursor's inner JSON payload contains a UUID, but the cursor string itself is a base64 wrapper. This mismatch caused client code generators and validation tools to reject valid API responses. --- .../open-api/utils/responses.utils.ts | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/packages/twenty-server/src/engine/core-modules/open-api/utils/responses.utils.ts b/packages/twenty-server/src/engine/core-modules/open-api/utils/responses.utils.ts index d55bf77610f..40a0a50d53c 100644 --- a/packages/twenty-server/src/engine/core-modules/open-api/utils/responses.utils.ts +++ b/packages/twenty-server/src/engine/core-modules/open-api/utils/responses.utils.ts @@ -32,14 +32,8 @@ export const getFindManyResponse200 = ( type: 'object', properties: { hasNextPage: { type: 'boolean' }, - startCursor: { - type: 'string', - format: 'uuid', - }, - endCursor: { - type: 'string', - format: 'uuid', - }, + startCursor: { type: 'string' }, + endCursor: { type: 'string' }, }, }, ...(!fromMetadata && { @@ -414,14 +408,8 @@ export const getFindDuplicatesResponse200 = ( type: 'object', properties: { hasNextPage: { type: 'boolean' }, - startCursor: { - type: 'string', - format: 'uuid', - }, - endCursor: { - type: 'string', - format: 'uuid', - }, + startCursor: { type: 'string' }, + endCursor: { type: 'string' }, }, }, [`${item.nameSingular}Duplicates`]: {