From a6ea282f1d259275ca33c314c1c38e668c36584c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Wed, 4 Sep 2024 17:01:38 +0100 Subject: [PATCH 1/2] fix: add request body schema in update segment endpoint --- src/lib/features/segment/segment-controller.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/features/segment/segment-controller.ts b/src/lib/features/segment/segment-controller.ts index e5c1b9573519..1c05e0e0c286 100644 --- a/src/lib/features/segment/segment-controller.ts +++ b/src/lib/features/segment/segment-controller.ts @@ -198,6 +198,7 @@ export class SegmentsController extends Controller { 'Updates the content of the segment with the provided payload. Any fields not specified will be left untouched.', tags: ['Segments'], operationId: 'updateSegment', + requestBody: createRequestSchema('upsertSegmentSchema'), responses: { 204: emptyResponse, ...getStandardResponses(400, 401, 403, 409, 415), From 6e6b3e7e2e9e924ac25ac1769435822c5fa7f443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Wed, 4 Sep 2024 17:26:03 +0100 Subject: [PATCH 2/2] fix: update endpoint description to correctly reflect its behavior. --- src/lib/features/segment/segment-controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/features/segment/segment-controller.ts b/src/lib/features/segment/segment-controller.ts index 1c05e0e0c286..5ee69b8f59b3 100644 --- a/src/lib/features/segment/segment-controller.ts +++ b/src/lib/features/segment/segment-controller.ts @@ -195,7 +195,7 @@ export class SegmentsController extends Controller { openApiService.validPath({ summary: 'Update segment by id', description: - 'Updates the content of the segment with the provided payload. Any fields not specified will be left untouched.', + 'Updates the content of the segment with the provided payload. Requires `name` and `constraints` to be present. If `project` is not present, it will be set to `null`. Any other fields not specified will be left untouched.', tags: ['Segments'], operationId: 'updateSegment', requestBody: createRequestSchema('upsertSegmentSchema'),