1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-21 13:47:39 +02:00
unleash.unleash/src/lib/openapi/spec/upsert-segment-schema.ts
Christopher Kolstad 53354224fc
chore: Bump biome and configure husky (#6589)
Upgrades biome to 1.6.1, and updates husky pre-commit hook.

Most changes here are making type imports explicit.
2024-03-18 13:58:05 +01:00

43 lines
1.3 KiB
TypeScript

import type { FromSchema } from 'json-schema-to-ts';
import { constraintSchema } from './constraint-schema';
export const upsertSegmentSchema = {
$id: '#/components/schemas/upsertSegmentSchema',
type: 'object',
description: 'Data used to create or update a segment',
required: ['name', 'constraints'],
properties: {
name: {
description: 'The name of the segment',
example: 'beta-users',
type: 'string',
},
description: {
type: 'string',
nullable: true,
description: 'A description of what the segment is for',
example: 'Users willing to help us test and build new features.',
},
project: {
type: 'string',
nullable: true,
description: 'The project the segment belongs to if any.',
example: 'red-vista',
},
constraints: {
type: 'array',
description: 'The list of constraints that make up this segment',
items: {
$ref: '#/components/schemas/constraintSchema',
},
},
},
components: {
schemas: {
constraintSchema,
},
},
} as const;
export type UpsertSegmentSchema = FromSchema<typeof upsertSegmentSchema>;