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
Christopher Kolstad 53354224fc
chore: Bump biome and configure husky (#6589)
Upgrades biome to 1.6.1, and updates husky pre-commit hook.

Most changes here are making type imports explicit.
2024-03-18 13:58:05 +01:00

41 lines
1.1 KiB
TypeScript

import type { 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,
description: 'User profile overview',
required: ['rootRole', 'projects', 'features'],
properties: {
rootRole: {
$ref: '#/components/schemas/roleSchema',
},
projects: {
description: 'Which projects this user is a member of',
type: 'array',
items: {
type: 'string',
},
example: ['my-projectA', 'my-projectB'],
},
features: {
description: 'Deprecated, always returns empty array',
type: 'array',
items: {
$ref: '#/components/schemas/featureSchema',
},
example: [],
},
},
components: {
schemas: {
featureSchema,
roleSchema,
},
},
} as const;
export type ProfileSchema = FromSchema<typeof profileSchema>;