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 ,
2023-07-04 16:41:16 +02:00
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 : {
2023-07-04 16:41:16 +02:00
description :
'A list of errors that prevent the provided data from being successfully imported.' ,
2023-02-16 08:08:51 +01:00
type : 'array' ,
2023-07-04 16:41:16 +02:00
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' ,
2023-07-04 16:41:16 +02:00
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' ,
2023-07-04 16:41:16 +02:00
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' ,
} ,
2023-07-04 16:41:16 +02:00
example : [ ] ,
2023-02-16 08:08:51 +01:00
} ,
} ,
components : {
schemas : {
importTogglesValidateItemSchema ,
} ,
} ,
} as const ;
export type ImportTogglesValidateSchema = FromSchema <
typeof importTogglesValidateSchema
> ;