1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-17 13:46:47 +02:00
unleash.unleash/src/lib/openapi/spec/create-user-response-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

35 lines
1.1 KiB
TypeScript

import type { FromSchema } from 'json-schema-to-ts';
import { userSchema } from './user-schema';
export const createUserResponseSchema = {
$id: '#/components/schemas/createUserResponseSchema',
type: 'object',
additionalProperties: false,
description: 'An Unleash user after creation',
required: ['id'],
properties: {
...userSchema.properties,
rootRole: {
description:
'Which [root role](https://docs.getunleash.io/reference/rbac#predefined-roles) this user is assigned. Usually a numeric role ID, but can be a string when returning newly created user with an explicit string role.',
oneOf: [
{
type: 'integer',
example: 1,
minimum: 0,
},
{
type: 'string',
example: 'Admin',
enum: ['Admin', 'Editor', 'Viewer', 'Owner', 'Member'],
},
],
},
},
components: {},
} as const;
export type CreateUserResponseSchema = FromSchema<
typeof createUserResponseSchema
>;