1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/src/lib/openapi/spec/api-tokens-schema.ts
Thomas Heartman 6d591fcd17
openapi: update API tokens tag (#4137)
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.
2023-07-06 07:30:31 +00:00

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>;