From 9fb2cbdb91e0cb7fa79a5b12a7e4b2bce75c68a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Thu, 7 Sep 2023 15:08:40 +0200 Subject: [PATCH] Revert "fix: api token schema (#4633)" This reverts commit fe51b501e6188f9f1687f8c62c2af8ff7859e0ff. --- .../api-token-schema.test.ts.snap | 18 ++++++++++++++++++ src/lib/openapi/spec/api-token-schema.ts | 9 ++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/lib/openapi/spec/__snapshots__/api-token-schema.test.ts.snap b/src/lib/openapi/spec/__snapshots__/api-token-schema.test.ts.snap index f5fa5d3a98a0..d1a3a22ec077 100644 --- a/src/lib/openapi/spec/__snapshots__/api-token-schema.test.ts.snap +++ b/src/lib/openapi/spec/__snapshots__/api-token-schema.test.ts.snap @@ -30,6 +30,24 @@ exports[`apiTokenSchema empty 1`] = ` }, "schemaPath": "#/required", }, + { + "instancePath": "", + "keyword": "required", + "message": "must have required property 'project'", + "params": { + "missingProperty": "project", + }, + "schemaPath": "#/required", + }, + { + "instancePath": "", + "keyword": "required", + "message": "must have required property 'projects'", + "params": { + "missingProperty": "projects", + }, + "schemaPath": "#/required", + }, { "instancePath": "", "keyword": "required", diff --git a/src/lib/openapi/spec/api-token-schema.ts b/src/lib/openapi/spec/api-token-schema.ts index 3a5ed742c87f..162d2cd4246c 100644 --- a/src/lib/openapi/spec/api-token-schema.ts +++ b/src/lib/openapi/spec/api-token-schema.ts @@ -5,7 +5,14 @@ export const apiTokenSchema = { $id: '#/components/schemas/apiTokenSchema', type: 'object', additionalProperties: false, - required: ['secret', 'tokenName', 'type', 'createdAt'], + required: [ + 'secret', + 'tokenName', + 'type', + 'project', + 'projects', + 'createdAt', + ], description: 'An overview of an [Unleash API token](https://docs.getunleash.io/reference/api-tokens-and-client-keys).', properties: {