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-feature-strategy-schema.ts
olav ac3f076a31
refactor: add schemas to strategy controller (#1744)
* refactor: avoid duplicate feature strategy operationIds

* refactor: fix flaky feature tests

* refactor: remove duplicate controller error handling

* refactor: unify feature strategy schemas

* refactor: add schemas to strategy controller
2022-06-23 08:10:20 +02:00

37 lines
927 B
TypeScript

import { FromSchema } from 'json-schema-to-ts';
import { parametersSchema } from './parameters-schema';
import { constraintSchema } from './constraint-schema';
export const createFeatureStrategySchema = {
$id: '#/components/schemas/createFeatureStrategySchema',
type: 'object',
required: ['name'],
properties: {
name: {
type: 'string',
},
sortOrder: {
type: 'number',
},
constraints: {
type: 'array',
items: {
$ref: '#/components/schemas/constraintSchema',
},
},
parameters: {
$ref: '#/components/schemas/parametersSchema',
},
},
components: {
schemas: {
constraintSchema,
parametersSchema,
},
},
} as const;
export type CreateFeatureStrategySchema = FromSchema<
typeof createFeatureStrategySchema
>;