1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00
unleash.unleash/src/lib/openapi/spec/profile-schema.ts

41 lines
1.1 KiB
TypeScript
Raw Normal View History

import { FromSchema } from 'json-schema-to-ts';
import { featureSchema } from './feature-schema';
import { roleSchema } from './role-schema';
export const profileSchema = {
$id: '#/components/schemas/profileSchema',
type: 'object',
additionalProperties: false,
2023-07-06 15:27:43 +02:00
description: 'User profile overview',
required: ['rootRole', 'projects', 'features'],
properties: {
rootRole: {
$ref: '#/components/schemas/roleSchema',
},
projects: {
2023-07-06 15:27:43 +02:00
description: 'Which projects this user is a member of',
type: 'array',
items: {
type: 'string',
},
2023-07-06 15:27:43 +02:00
example: ['my-projectA', 'my-projectB'],
},
features: {
2023-07-06 15:27:43 +02:00
description: 'Deprecated, always returns empty array',
type: 'array',
items: {
$ref: '#/components/schemas/featureSchema',
},
2023-07-06 15:27:43 +02:00
example: [],
},
},
components: {
schemas: {
featureSchema,
roleSchema,
},
},
} as const;
export type ProfileSchema = FromSchema<typeof profileSchema>;