mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
feat: update openapi schema for feature creation for tags (#7657)
Added tags support for schema.
This commit is contained in:
parent
d8c5466099
commit
0148481623
31
src/lib/openapi/spec/create-feature-schema.test.ts
Normal file
31
src/lib/openapi/spec/create-feature-schema.test.ts
Normal 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();
|
||||||
|
});
|
@ -30,6 +30,14 @@ export const createFeatureSchema = {
|
|||||||
description:
|
description:
|
||||||
'`true` if the impression data collection is enabled for the feature, otherwise `false`.',
|
'`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: {},
|
components: {},
|
||||||
} as const;
|
} as const;
|
||||||
|
Loading…
Reference in New Issue
Block a user