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
andreas-unleash e875e67d24
open api implementation - client features controller (#1745)
* open api implementation - client features controller

* open api implementation - client features controller

* bug fix

* test fix

* PR comments

* OAS for client-api metrics.ts

* Refactoring

* Refactoring

* bug fix

* fix PR comments

* PR comment

* PR comment
2022-06-30 12:54:14 +03:00

35 lines
816 B
TypeScript

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>;