1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00
unleash.unleash/src/lib/openapi/spec/pats-schema.ts
David Leek 546f9953a7
docs: openapi schema for PATs (#3605)
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->

## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

OpenAPI schema updates for Personal Access Tokens, http statuses,
property types and examples, return types

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-05-11 09:11:17 +02:00

26 lines
719 B
TypeScript

import { FromSchema } from 'json-schema-to-ts';
import { patSchema } from './pat-schema';
export const patsSchema = {
$id: '#/components/schemas/patsSchema',
type: 'object',
description:
'Contains a collection of [Personal Access Tokens](https://docs.getunleash.io/how-to/how-to-create-personal-access-tokens).',
properties: {
pats: {
type: 'array',
items: {
$ref: '#/components/schemas/patSchema',
},
description: 'A collection of Personal Access Tokens',
},
},
components: {
schemas: {
patSchema,
},
},
} as const;
export type PatsSchema = FromSchema<typeof patsSchema>;