1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-11-01 19:07:38 +01:00
unleash.unleash/src/lib/openapi/spec/segment-schema.ts

35 lines
816 B
TypeScript
Raw Normal View History

import { FromSchema } from 'json-schema-to-ts';
import { constraintSchema } from './constraint-schema';
export const segmentSchema = {
$id: '#/components/schemas/segmentSchema',
type: 'object',
additionalProperties: false,
required: ['id', 'constraints'],
properties: {
id: {
type: 'number',
},
name: {
type: 'string',
},
description: {
type: 'string',
nullable: true,
},
constraints: {
type: 'array',
items: {
$ref: '#/components/schemas/constraintSchema',
},
},
},
components: {
schemas: {
constraintSchema,
},
},
} as const;
export type SegmentSchema = FromSchema<typeof segmentSchema>;