1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-17 13:46:47 +02:00
unleash.unleash/src/lib/openapi/spec/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

47 lines
1.4 KiB
TypeScript

import type { FromSchema } from 'json-schema-to-ts';
import { constraintSchema } from './constraint-schema';
import { clientSegmentSchema } from './client-segment-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: {
...clientSegmentSchema.properties,
description: {
type: 'string',
nullable: true,
description: 'The description of the segment.',
example: 'Segment A description',
},
createdAt: {
type: 'string',
format: 'date-time',
description:
'The time the segment was created as a RFC 3339-conformant timestamp.',
example: '2023-07-05T12:56:00.000Z',
},
createdBy: {
type: 'string',
description: 'Which user created this segment',
example: 'johndoe',
},
project: {
type: 'string',
nullable: true,
description: 'The project the segment relates to, if applicable.',
example: 'default',
},
},
components: {
schemas: {
constraintSchema,
},
},
} as const;
export type SegmentSchema = FromSchema<typeof segmentSchema>;