From feab6db76e6abce42f756c7344c10e0067d60a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Thu, 7 Sep 2023 15:25:49 +0200 Subject: [PATCH] Revert "fix: api token schema" (#4638) Reverts Unleash/unleash#4633 because of https://github.com/Unleash/unleash/pull/4633#issuecomment-1710122769 --- .../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 f5fa5d3a98..d1a3a22ec0 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 3a5ed742c8..162d2cd424 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: {