mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
ac3f076a31
* 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
37 lines
927 B
TypeScript
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
|
|
>;
|