1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00
unleash.unleash/src/lib/openapi/spec/import-toggles-validate-schema.ts

61 lines
2.3 KiB
TypeScript
Raw Normal View History

2023-02-16 08:08:51 +01:00
import { FromSchema } from 'json-schema-to-ts';
import { importTogglesValidateItemSchema } from './import-toggles-validate-item-schema';
export const importTogglesValidateSchema = {
$id: '#/components/schemas/importTogglesValidateSchema',
type: 'object',
required: ['errors', 'warnings'],
additionalProperties: false,
description:
'An object containing [feature import](https://docs.getunleash.io/reference/deploy/environment-import-export) validation results.',
2023-02-16 08:08:51 +01:00
properties: {
errors: {
description:
'A list of errors that prevent the provided data from being successfully imported.',
2023-02-16 08:08:51 +01:00
type: 'array',
example: [
{
message:
'You cannot import a feature that already exist in other projects. You already have the following features defined outside of project default:',
affectedItems: ['my-feature (in project project-854)'],
},
],
2023-02-16 08:08:51 +01:00
items: {
$ref: '#/components/schemas/importTogglesValidateItemSchema',
},
},
warnings: {
type: 'array',
description: 'A list of warnings related to the provided data.',
example: [
{
message:
'The following strategy types will be used in import. Please make sure the strategy type parameters are configured as in source environment:',
affectedItems: ['custom-strategy-7'],
},
],
2023-02-16 08:08:51 +01:00
items: {
$ref: '#/components/schemas/importTogglesValidateItemSchema',
},
},
permissions: {
type: 'array',
description:
'Any additional permissions required to import the data. If the list is empty, you require no additional permissions beyond what your user already has.',
2023-02-16 08:08:51 +01:00
items: {
$ref: '#/components/schemas/importTogglesValidateItemSchema',
},
example: [],
2023-02-16 08:08:51 +01:00
},
},
components: {
schemas: {
importTogglesValidateItemSchema,
},
},
} as const;
export type ImportTogglesValidateSchema = FromSchema<
typeof importTogglesValidateSchema
>;