mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
6cc51b7ba0
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>
28 lines
843 B
TypeScript
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
|
|
>;
|