1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/src/lib/openapi/spec/create-strategy-schema.ts

26 lines
670 B
TypeScript
Raw Normal View History

import { createSchemaObject, CreateSchemaType } from '../types';
import { parametersSchema } from './parameters-schema';
import { constraintSchema } from './constraint-schema';
const schema = {
type: 'object',
additionalProperties: false,
properties: {
name: {
type: 'string',
},
sortOrder: {
type: 'number',
},
constraints: {
type: 'array',
items: constraintSchema,
},
parameters: parametersSchema,
},
} as const;
export type CreateStrategySchema = CreateSchemaType<typeof schema>;
export const createStrategySchema = createSchemaObject(schema);