From 18fed92e91c024550e8ff61f018175dbefaea06f Mon Sep 17 00:00:00 2001 From: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:49:09 +0100 Subject: [PATCH] fix schema --- .../spec/upsert-segment-schema.test copy.ts | 44 ------------------- src/lib/openapi/spec/user-schema.ts | 1 + 2 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 src/lib/openapi/spec/upsert-segment-schema.test copy.ts diff --git a/src/lib/openapi/spec/upsert-segment-schema.test copy.ts b/src/lib/openapi/spec/upsert-segment-schema.test copy.ts deleted file mode 100644 index 4342baf5d5..0000000000 --- a/src/lib/openapi/spec/upsert-segment-schema.test copy.ts +++ /dev/null @@ -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(), - ); -}); diff --git a/src/lib/openapi/spec/user-schema.ts b/src/lib/openapi/spec/user-schema.ts index 9a48dbf666..bb44dae6bd 100644 --- a/src/lib/openapi/spec/user-schema.ts +++ b/src/lib/openapi/spec/user-schema.ts @@ -102,6 +102,7 @@ export const userSchema = { settings: { description: 'User settings', type: 'object', + nullable: true, additionalProperties: { type: 'string', },