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/constraint-schema.ts

35 lines
770 B
TypeScript
Raw Normal View History

import { createSchemaObject, CreateSchemaType } from '../types';
const schema = {
type: 'object',
additionalProperties: false,
required: ['contextName', 'operator'],
properties: {
contextName: {
type: 'string',
},
operator: {
type: 'string',
},
caseInsensitive: {
type: 'boolean',
},
inverted: {
type: 'boolean',
},
values: {
type: 'array',
items: {
type: 'string',
},
},
value: {
type: 'string',
},
},
} as const;
export type ConstraintSchema = CreateSchemaType<typeof schema>;
export const constraintSchema = createSchemaObject(schema);