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

fix schema

This commit is contained in:
Tymoteusz Czech 2024-10-29 09:49:09 +01:00
parent 2f6e67a2bd
commit 18fed92e91
No known key found for this signature in database
GPG Key ID: 133555230D88D75F
2 changed files with 1 additions and 44 deletions

View File

@ -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(),
);
});

View File

@ -102,6 +102,7 @@ export const userSchema = {
settings: {
description: 'User settings',
type: 'object',
nullable: true,
additionalProperties: {
type: 'string',
},