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/update-feature-strategy-schema.ts
Tymoteusz Czech ace499d7c6
Update OpenAPI feature strategies (#4175)
## About the changes
Updates for endpoint
`/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies`
and similar
2023-07-07 15:45:04 +00:00

55 lines
1.7 KiB
TypeScript

import { FromSchema } from 'json-schema-to-ts';
import { parametersSchema } from './parameters-schema';
import { constraintSchema } from './constraint-schema';
export const updateFeatureStrategySchema = {
$id: '#/components/schemas/updateFeatureStrategySchema',
type: 'object',
description: 'Update a strategy configuration in a feature',
properties: {
name: {
type: 'string',
description: 'The name of the strategy type',
},
sortOrder: {
type: 'number',
description:
'The order of the strategy in the list in feature environment configuration',
},
constraints: {
type: 'array',
items: {
$ref: '#/components/schemas/constraintSchema',
},
description:
'A list of the constraints attached to the strategy. See https://docs.getunleash.io/reference/strategy-constraints',
},
title: {
type: 'string',
nullable: true,
description: 'A descriptive title for the strategy',
example: 'Gradual Rollout 25-Prod',
},
disabled: {
type: 'boolean',
description:
'A toggle to disable the strategy. defaults to true. Disabled strategies are not evaluated or returned to the SDKs',
example: false,
nullable: true,
},
parameters: {
$ref: '#/components/schemas/parametersSchema',
},
},
components: {
schemas: {
constraintSchema,
parametersSchema,
},
},
} as const;
export type UpdateFeatureStrategySchema = FromSchema<
typeof updateFeatureStrategySchema
>;