From 46b4030d47c9a926dfe71118080d18258f38fa1b Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 6 Jul 2023 13:39:23 +0200 Subject: [PATCH] bug: mark descriptions on strategies as nullable (#4156) This was omitted by mistake. Fixes 1-1086 --- src/lib/openapi/spec/strategy-schema.test.ts | 8 ++++++++ src/lib/openapi/spec/strategy-schema.ts | 1 + 2 files changed, 9 insertions(+) diff --git a/src/lib/openapi/spec/strategy-schema.test.ts b/src/lib/openapi/spec/strategy-schema.test.ts index 59121c490f..3d7f361b56 100644 --- a/src/lib/openapi/spec/strategy-schema.test.ts +++ b/src/lib/openapi/spec/strategy-schema.test.ts @@ -23,6 +23,14 @@ test('strategySchema', () => { validateSchema('#/components/schemas/strategySchema', data), ).toBeUndefined(); + // allow null descriptions + expect( + validateSchema('#/components/schemas/strategySchema', { + ...data, + description: null, + }), + ).toBeUndefined(); + expect( validateSchema('#/components/schemas/strategySchema', {}), ).toMatchSnapshot(); diff --git a/src/lib/openapi/spec/strategy-schema.ts b/src/lib/openapi/spec/strategy-schema.ts index bb856e0921..fb3b0c2c67 100644 --- a/src/lib/openapi/spec/strategy-schema.ts +++ b/src/lib/openapi/spec/strategy-schema.ts @@ -34,6 +34,7 @@ export const strategySchema = { }, description: { type: 'string', + nullable: true, description: 'A short description of the strategy', example: 'Gradual rollout to logged in users', },