mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
6d591fcd17
This PR updates endpoints and schemas for the API tokens tag. As part of that, they also handle oneOf openapi validation errors and improve the console output for the enforcer tests.
28 lines
790 B
TypeScript
28 lines
790 B
TypeScript
import { FromSchema } from 'json-schema-to-ts';
|
|
import { apiTokenSchema } from './api-token-schema';
|
|
|
|
export const apiTokensSchema = {
|
|
$id: '#/components/schemas/apiTokensSchema',
|
|
type: 'object',
|
|
description:
|
|
'An object with [Unleash API tokens](https://docs.getunleash.io/reference/api-tokens-and-client-keys)',
|
|
additionalProperties: false,
|
|
required: ['tokens'],
|
|
properties: {
|
|
tokens: {
|
|
type: 'array',
|
|
description: 'A list of Unleash API tokens.',
|
|
items: {
|
|
$ref: '#/components/schemas/apiTokenSchema',
|
|
},
|
|
},
|
|
},
|
|
components: {
|
|
schemas: {
|
|
apiTokenSchema,
|
|
},
|
|
},
|
|
} as const;
|
|
|
|
export type ApiTokensSchema = FromSchema<typeof apiTokensSchema>;
|