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: {