mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-17 13:46:47 +02:00
Adds an endpoint to return all event creators. An interesting point is that it does not return the user object, but just created_by as a string. This is because we do not store user IDs for events, as they are not strictly bound to a user object, but rather a historical user with the name X.
32 lines
943 B
TypeScript
32 lines
943 B
TypeScript
import type { FromSchema } from 'json-schema-to-ts';
|
|
|
|
export const eventCreatorsSchema = {
|
|
$id: '#/components/schemas/eventCreatorsSchema',
|
|
type: 'array',
|
|
description: 'A list of event creators',
|
|
items: {
|
|
type: 'object',
|
|
additionalProperties: false,
|
|
required: ['id', 'name'],
|
|
properties: {
|
|
id: {
|
|
type: 'integer',
|
|
example: 50,
|
|
description: 'The user id.',
|
|
},
|
|
name: {
|
|
description:
|
|
"Name of the user. If the user has no set name, the API falls back to using the user's username (if they have one) or email (if neither name or username is set).",
|
|
type: 'string',
|
|
example: 'User',
|
|
},
|
|
},
|
|
},
|
|
|
|
components: {
|
|
schemas: {},
|
|
},
|
|
} as const;
|
|
|
|
export type EventCreatorsSchema = FromSchema<typeof eventCreatorsSchema>;
|