1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00
unleash.unleash/src/lib/openapi/spec/validated-edge-tokens-schema.ts
Christopher Kolstad 6cc51b7ba0
docs: Added docs for edge endpoints (#3501)
Adding documentation for the edge endpoints. Also separating request and
response schema for our validate endpoint to make clear that we expect a
list of strings as input, but yield tokens as output.

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-04-14 15:39:39 +02:00

28 lines
843 B
TypeScript

import { FromSchema } from 'json-schema-to-ts';
import { edgeTokenSchema } from './edge-token-schema';
export const validatedEdgeTokensSchema = {
$id: '#/components/schemas/validatedEdgeTokensSchema',
type: 'object',
additionalProperties: false,
required: ['tokens'],
description: `A object containing a list of valid Unleash tokens.`,
properties: {
tokens: {
description:
'The list of Unleash token objects. Each object contains the token itself and some additional metadata.',
type: 'array',
items: { $ref: '#/components/schemas/edgeTokenSchema' },
},
},
components: {
schemas: {
edgeTokenSchema,
},
},
} as const;
export type ValidatedEdgeTokensSchema = FromSchema<
typeof validatedEdgeTokensSchema
>;