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', },