1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

feat: update openapi schema for feature creation for tags (#7657)

Added tags support for schema.
This commit is contained in:
Jaanus Sellin 2024-07-25 10:36:04 +03:00 committed by GitHub
parent d8c5466099
commit 0148481623
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,31 @@
import { validateSchema } from '../validate';
import type { CreateFeatureSchema } from './create-feature-schema';
test('createFeatureSchema', () => {
const data: CreateFeatureSchema = {
name: 'disable-comments',
type: 'release',
description:
'Controls disabling of the comments section in case of an incident',
impressionData: false,
tags: ['simple:test', 'simple:test2'],
};
expect(
validateSchema('#/components/schemas/createFeatureSchema', data),
).toBeUndefined();
});
test('createFeatureSchema without tags', () => {
const data: CreateFeatureSchema = {
name: 'disable-comments',
type: 'release',
description:
'Controls disabling of the comments section in case of an incident',
impressionData: false,
};
expect(
validateSchema('#/components/schemas/createFeatureSchema', data),
).toBeUndefined();
});

View File

@ -30,6 +30,14 @@ export const createFeatureSchema = {
description:
'`true` if the impression data collection is enabled for the feature, otherwise `false`.',
},
tags: {
type: 'array',
items: {
type: 'string',
example: 'simple:test',
},
description: 'List of tags associated with the feature',
},
},
components: {},
} as const;