1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +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', 'roleSchema',
'sdkContextSchema', 'sdkContextSchema',
'searchEventsSchema', 'searchEventsSchema',
'segmentSchema',
'setUiConfigSchema', 'setUiConfigSchema',
'splashSchema', 'splashSchema',
'stateSchema', 'stateSchema',
@ -179,7 +178,6 @@ const metaRules: Rule[] = [
'updateTagTypeSchema', 'updateTagTypeSchema',
'updateUserSchema', 'updateUserSchema',
'upsertContextFieldSchema', 'upsertContextFieldSchema',
'upsertSegmentSchema',
'upsertStrategySchema', 'upsertStrategySchema',
'userSchema', 'userSchema',
'usersGroupsBaseSchema', 'usersGroupsBaseSchema',
@ -287,7 +285,6 @@ const metaRules: Rule[] = [
'requestsPerSecondSchema', 'requestsPerSecondSchema',
'requestsPerSecondSegmentedSchema', 'requestsPerSecondSegmentedSchema',
'roleSchema', 'roleSchema',
'segmentSchema',
'setStrategySortOrderSchema', 'setStrategySortOrderSchema',
'setUiConfigSchema', 'setUiConfigSchema',
'sortOrderSchema', 'sortOrderSchema',
@ -306,7 +303,6 @@ const metaRules: Rule[] = [
'updateTagTypeSchema', 'updateTagTypeSchema',
'updateUserSchema', 'updateUserSchema',
'upsertContextFieldSchema', 'upsertContextFieldSchema',
'upsertSegmentSchema',
'upsertStrategySchema', 'upsertStrategySchema',
'userSchema', 'userSchema',
'usersGroupsBaseSchema', 'usersGroupsBaseSchema',

View File

@ -4,18 +4,25 @@ import { constraintSchema } from './constraint-schema';
export const segmentSchema = { export const segmentSchema = {
$id: '#/components/schemas/segmentSchema', $id: '#/components/schemas/segmentSchema',
type: 'object', type: 'object',
description:
'Represents a segment of users defined by a set of constraints.',
additionalProperties: false, additionalProperties: false,
required: ['id', 'constraints'], required: ['id', 'constraints'],
properties: { properties: {
id: { id: {
type: 'number', type: 'number',
description: "The segment's id.",
}, },
name: { name: {
type: 'string', type: 'string',
description: 'The name of the segment.',
example: 'segment A',
}, },
description: { description: {
type: 'string', type: 'string',
nullable: true, nullable: true,
description: 'The description of the segment.',
example: 'Segment A description',
}, },
constraints: { constraints: {
type: 'array', type: 'array',

View File

@ -4,14 +4,18 @@ import { constraintSchema } from './constraint-schema';
export const upsertSegmentSchema = { export const upsertSegmentSchema = {
$id: '#/components/schemas/upsertSegmentSchema', $id: '#/components/schemas/upsertSegmentSchema',
type: 'object', type: 'object',
description:
'Represents a segment of users defined by a set of constraints.',
required: ['name', 'constraints'], required: ['name', 'constraints'],
properties: { properties: {
name: { name: {
type: 'string', type: 'string',
description: 'The name of the segment.',
}, },
description: { description: {
type: 'string', type: 'string',
nullable: true, nullable: true,
description: 'The description of the segment.',
}, },
project: { project: {
type: 'string', type: 'string',

View File

@ -3538,6 +3538,7 @@ Stats are divided into current and previous **windows**.
}, },
"segmentSchema": { "segmentSchema": {
"additionalProperties": false, "additionalProperties": false,
"description": "Represents a segment of users defined by a set of constraints.",
"properties": { "properties": {
"constraints": { "constraints": {
"description": "List of constraints that determine which users are part of the segment", "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", "type": "array",
}, },
"description": { "description": {
"description": "The description of the segment.",
"example": "Segment A description",
"nullable": true, "nullable": true,
"type": "string", "type": "string",
}, },
"id": { "id": {
"description": "The segment's id.",
"type": "number", "type": "number",
}, },
"name": { "name": {
"description": "The name of the segment.",
"example": "segment A",
"type": "string", "type": "string",
}, },
}, },
@ -4208,6 +4214,7 @@ Stats are divided into current and previous **windows**.
"type": "object", "type": "object",
}, },
"upsertSegmentSchema": { "upsertSegmentSchema": {
"description": "Represents a segment of users defined by a set of constraints.",
"example": { "example": {
"constraints": [ "constraints": [
{ {
@ -4232,10 +4239,12 @@ Stats are divided into current and previous **windows**.
"type": "array", "type": "array",
}, },
"description": { "description": {
"description": "The description of the segment.",
"nullable": true, "nullable": true,
"type": "string", "type": "string",
}, },
"name": { "name": {
"description": "The name of the segment.",
"type": "string", "type": "string",
}, },
"project": { "project": {