mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix schema
This commit is contained in:
parent
2f6e67a2bd
commit
18fed92e91
@ -1,44 +0,0 @@
|
||||
import { validateSchema } from '../validate';
|
||||
|
||||
test('upsertSegmentSchema', () => {
|
||||
const validObjects = [
|
||||
{
|
||||
name: 'segment',
|
||||
constraints: [],
|
||||
},
|
||||
{
|
||||
name: 'segment',
|
||||
description: 'description',
|
||||
constraints: [],
|
||||
},
|
||||
{
|
||||
name: 'segment',
|
||||
description: 'description',
|
||||
constraints: [],
|
||||
additional: 'property',
|
||||
},
|
||||
];
|
||||
|
||||
validObjects.forEach((obj) =>
|
||||
expect(
|
||||
validateSchema('#/components/schemas/upsertSegmentSchema', obj),
|
||||
).toBeUndefined(),
|
||||
);
|
||||
|
||||
const invalidObjects = [
|
||||
{
|
||||
name: 'segment',
|
||||
},
|
||||
{
|
||||
description: 'description',
|
||||
constraints: [],
|
||||
},
|
||||
{},
|
||||
];
|
||||
|
||||
invalidObjects.forEach((obj) =>
|
||||
expect(
|
||||
validateSchema('#/components/schemas/upsertSegmentSchema', obj),
|
||||
).toMatchSnapshot(),
|
||||
);
|
||||
});
|
@ -102,6 +102,7 @@ export const userSchema = {
|
||||
settings: {
|
||||
description: 'User settings',
|
||||
type: 'object',
|
||||
nullable: true,
|
||||
additionalProperties: {
|
||||
type: 'string',
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user