1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00
unleash.unleash/src/lib/openapi/spec/me-schema.ts
Thomas Heartman 8f5bda6b8a
openapi: document operations for admin ui feedback (#4226)
This PR updates the endpoint documentation and schemas related to Admin
UI feedback.
2023-07-13 13:27:52 +02:00

48 lines
1.4 KiB
TypeScript

import { FromSchema } from 'json-schema-to-ts';
import { userSchema } from './user-schema';
import { permissionSchema } from './permission-schema';
import { feedbackResponseSchema } from './feedback-response-schema';
export const meSchema = {
$id: '#/components/schemas/meSchema',
type: 'object',
additionalProperties: false,
required: ['user', 'permissions', 'feedback', 'splash'],
description: 'Detailed user information',
properties: {
user: {
$ref: '#/components/schemas/userSchema',
},
permissions: {
description: 'User permissions for projects and environments',
type: 'array',
items: {
$ref: '#/components/schemas/permissionSchema',
},
},
feedback: {
description: 'User feedback information',
type: 'array',
items: {
$ref: '#/components/schemas/feedbackResponseSchema',
},
},
splash: {
description: 'Splash screen configuration',
type: 'object',
additionalProperties: {
type: 'boolean',
},
},
},
components: {
schemas: {
userSchema,
permissionSchema,
feedbackResponseSchema,
},
},
} as const;
export type MeSchema = FromSchema<typeof meSchema>;