mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-10 01:16:39 +02:00
* Feat: add initial event schema * Feat: add events-schema plus tests * Feat(broken): add openapi validation to getEvents endpoint * Add schema to basic events endpoint * Feat: Add openapi for feature events * Fix: fix recursive schema inclusion * Feat: add test for recursive function * Fix: make nullable fields nullable * Fix: remove `ADMIN` permission for toggle events. * fix: add new schemas to the snapshot * Fix: remove recursive schema inclusion * Feat: test feature events schema * Fix: add correct permissions for feature events endpoint. * Refactor: rename "name" to "featureName" for clearer docs * Fix: Add missing "version" field to feature events * Feat: add descriptions and extra responses to events endpoints. * Fix: update openapi snapshot * Simplify standard responses function * Refactor: move endpoint descriptions into own file. * Refactor: simplify type signature. * Feat: specify type of data and preData properties to object * Fix: update snapshot * Refactor: move standard-responses into /util/ directory.
29 lines
689 B
TypeScript
29 lines
689 B
TypeScript
import { FromSchema } from 'json-schema-to-ts';
|
|
import { eventSchema } from './event-schema';
|
|
import { tagSchema } from './tag-schema';
|
|
|
|
export const eventsSchema = {
|
|
$id: '#/components/schemas/eventsSchema',
|
|
type: 'object',
|
|
additionalProperties: false,
|
|
required: ['version', 'events'],
|
|
properties: {
|
|
version: {
|
|
type: 'integer',
|
|
minimum: 1,
|
|
},
|
|
events: {
|
|
type: 'array',
|
|
items: { $ref: eventSchema.$id },
|
|
},
|
|
},
|
|
components: {
|
|
schemas: {
|
|
eventSchema,
|
|
tagSchema,
|
|
},
|
|
},
|
|
} as const;
|
|
|
|
export type EventsSchema = FromSchema<typeof eventsSchema>;
|