mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +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: {
|
settings: {
|
||||||
description: 'User settings',
|
description: 'User settings',
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
nullable: true,
|
||||||
additionalProperties: {
|
additionalProperties: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user