mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
|
import { FromSchema } from 'json-schema-to-ts';
|
||
|
import { playgroundConstraintSchema } from './playground-constraint-schema';
|
||
|
|
||
|
export const playgroundSegmentSchema = {
|
||
|
$id: '#/components/schemas/playgroundSegmentSchema',
|
||
|
type: 'object',
|
||
|
additionalProperties: false,
|
||
|
required: ['name', 'id', 'constraints', 'result'],
|
||
|
properties: {
|
||
|
id: {
|
||
|
description: "The segment's id.",
|
||
|
type: 'integer',
|
||
|
},
|
||
|
name: {
|
||
|
description: 'The name of the segment.',
|
||
|
example: 'segment A',
|
||
|
type: 'string',
|
||
|
},
|
||
|
result: {
|
||
|
description: 'Whether this was evaluated as true or false.',
|
||
|
type: 'boolean',
|
||
|
},
|
||
|
constraints: {
|
||
|
type: 'array',
|
||
|
description: 'The list of constraints in this segment.',
|
||
|
items: { $ref: playgroundConstraintSchema.$id },
|
||
|
},
|
||
|
},
|
||
|
components: {
|
||
|
schemas: {
|
||
|
playgroundConstraintSchema,
|
||
|
},
|
||
|
},
|
||
|
} as const;
|
||
|
|
||
|
export type PlaygroundSegmentSchema = FromSchema<
|
||
|
typeof playgroundSegmentSchema
|
||
|
>;
|