diff --git a/src/lib/openapi/meta-schema-rules.test.ts b/src/lib/openapi/meta-schema-rules.test.ts index 41cc6d4587..1d03c409d8 100644 --- a/src/lib/openapi/meta-schema-rules.test.ts +++ b/src/lib/openapi/meta-schema-rules.test.ts @@ -162,7 +162,6 @@ const metaRules: Rule[] = [ 'roleSchema', 'sdkContextSchema', 'searchEventsSchema', - 'segmentSchema', 'setUiConfigSchema', 'splashSchema', 'stateSchema', @@ -179,7 +178,6 @@ const metaRules: Rule[] = [ 'updateTagTypeSchema', 'updateUserSchema', 'upsertContextFieldSchema', - 'upsertSegmentSchema', 'upsertStrategySchema', 'userSchema', 'usersGroupsBaseSchema', @@ -287,7 +285,6 @@ const metaRules: Rule[] = [ 'requestsPerSecondSchema', 'requestsPerSecondSegmentedSchema', 'roleSchema', - 'segmentSchema', 'setStrategySortOrderSchema', 'setUiConfigSchema', 'sortOrderSchema', @@ -306,7 +303,6 @@ const metaRules: Rule[] = [ 'updateTagTypeSchema', 'updateUserSchema', 'upsertContextFieldSchema', - 'upsertSegmentSchema', 'upsertStrategySchema', 'userSchema', 'usersGroupsBaseSchema', diff --git a/src/lib/openapi/spec/segment-schema.ts b/src/lib/openapi/spec/segment-schema.ts index 15b8b4fe9a..52d287b53e 100644 --- a/src/lib/openapi/spec/segment-schema.ts +++ b/src/lib/openapi/spec/segment-schema.ts @@ -4,18 +4,25 @@ import { constraintSchema } from './constraint-schema'; export const segmentSchema = { $id: '#/components/schemas/segmentSchema', type: 'object', + description: + 'Represents a segment of users defined by a set of constraints.', additionalProperties: false, required: ['id', 'constraints'], properties: { id: { type: 'number', + description: "The segment's id.", }, name: { type: 'string', + description: 'The name of the segment.', + example: 'segment A', }, description: { type: 'string', nullable: true, + description: 'The description of the segment.', + example: 'Segment A description', }, constraints: { type: 'array', diff --git a/src/lib/openapi/spec/upsert-segment-schema.ts b/src/lib/openapi/spec/upsert-segment-schema.ts index f6d9765906..1377d29814 100644 --- a/src/lib/openapi/spec/upsert-segment-schema.ts +++ b/src/lib/openapi/spec/upsert-segment-schema.ts @@ -4,14 +4,18 @@ import { constraintSchema } from './constraint-schema'; export const upsertSegmentSchema = { $id: '#/components/schemas/upsertSegmentSchema', type: 'object', + description: + 'Represents a segment of users defined by a set of constraints.', required: ['name', 'constraints'], properties: { name: { type: 'string', + description: 'The name of the segment.', }, description: { type: 'string', nullable: true, + description: 'The description of the segment.', }, project: { type: 'string', diff --git a/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap b/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap index ab7b385e92..249df6326d 100644 --- a/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap +++ b/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap @@ -3538,6 +3538,7 @@ Stats are divided into current and previous **windows**. }, "segmentSchema": { "additionalProperties": false, + "description": "Represents a segment of users defined by a set of constraints.", "properties": { "constraints": { "description": "List of constraints that determine which users are part of the segment", @@ -3547,13 +3548,18 @@ Stats are divided into current and previous **windows**. "type": "array", }, "description": { + "description": "The description of the segment.", + "example": "Segment A description", "nullable": true, "type": "string", }, "id": { + "description": "The segment's id.", "type": "number", }, "name": { + "description": "The name of the segment.", + "example": "segment A", "type": "string", }, }, @@ -4208,6 +4214,7 @@ Stats are divided into current and previous **windows**. "type": "object", }, "upsertSegmentSchema": { + "description": "Represents a segment of users defined by a set of constraints.", "example": { "constraints": [ { @@ -4232,10 +4239,12 @@ Stats are divided into current and previous **windows**. "type": "array", }, "description": { + "description": "The description of the segment.", "nullable": true, "type": "string", }, "name": { + "description": "The name of the segment.", "type": "string", }, "project": {