mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-24 01:18:01 +02:00
## About the changes Fix OpenAPI definitions for endpoint `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}` and similar.
76 lines
2.3 KiB
TypeScript
76 lines
2.3 KiB
TypeScript
import { FromSchema } from 'json-schema-to-ts';
|
|
import { constraintSchema } from './constraint-schema';
|
|
import { parametersSchema } from './parameters-schema';
|
|
import { featureStrategySchema } from './feature-strategy-schema';
|
|
import { variantSchema } from './variant-schema';
|
|
|
|
export const featureEnvironmentSchema = {
|
|
$id: '#/components/schemas/featureEnvironmentSchema',
|
|
type: 'object',
|
|
additionalProperties: false,
|
|
required: ['name', 'enabled'],
|
|
description: 'A detailed description of the feature environment',
|
|
properties: {
|
|
name: {
|
|
type: 'string',
|
|
example: 'my-dev-env',
|
|
description: 'The name of the environment',
|
|
},
|
|
featureName: {
|
|
type: 'string',
|
|
example: 'disable-comments',
|
|
},
|
|
environment: {
|
|
type: 'string',
|
|
},
|
|
type: {
|
|
type: 'string',
|
|
example: 'development',
|
|
description: 'The type of the environment',
|
|
},
|
|
enabled: {
|
|
type: 'boolean',
|
|
example: true,
|
|
description:
|
|
'`true` if the feature is enabled for the environment, otherwise `false`.',
|
|
},
|
|
sortOrder: {
|
|
type: 'number',
|
|
example: 3,
|
|
description:
|
|
'The sort order of the feature environment in the feature environments list',
|
|
},
|
|
variantCount: {
|
|
type: 'number',
|
|
description: 'The number of defined variants',
|
|
},
|
|
strategies: {
|
|
type: 'array',
|
|
items: {
|
|
$ref: '#/components/schemas/featureStrategySchema',
|
|
},
|
|
description:
|
|
'A list of activation strategies for the feature environment',
|
|
},
|
|
variants: {
|
|
type: 'array',
|
|
items: {
|
|
$ref: '#/components/schemas/variantSchema',
|
|
},
|
|
description: 'A list of variants for the feature environment',
|
|
},
|
|
},
|
|
components: {
|
|
schemas: {
|
|
constraintSchema,
|
|
parametersSchema,
|
|
featureStrategySchema,
|
|
variantSchema,
|
|
},
|
|
},
|
|
} as const;
|
|
|
|
export type FeatureEnvironmentSchema = FromSchema<
|
|
typeof featureEnvironmentSchema
|
|
>;
|