From 45a3909618bb8184bd401fe9a8af457181e19bf3 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Wed, 20 Jul 2022 14:37:28 +0200 Subject: [PATCH] Chore: Allow the example keyword in params --- src/lib/openapi/validate.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/openapi/validate.ts b/src/lib/openapi/validate.ts index 36b9a678fd..7d2e59ba78 100644 --- a/src/lib/openapi/validate.ts +++ b/src/lib/openapi/validate.ts @@ -16,6 +16,10 @@ const ajv = new Ajv({ addFormats(ajv, ['date-time']); +// example was superseded by examples in openapi 3.1, but we're still on 3.0, so +// let's add it back in! +ajv.addKeyword('example'); + export const validateSchema = ( schema: SchemaId, data: unknown,