1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

fix: segments schemas (#3525)

## About the changes
Remove segment schemas from exceptions

---------

Co-authored-by: GitHub Actions Bot <>
This commit is contained in:
Gastón Fournier 2023-04-17 10:51:48 +02:00 committed by GitHub
parent 97f8f54d18
commit 4f78db3be9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 4 deletions

View File

@ -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',

View File

@ -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',

View File

@ -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',

View File

@ -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": {