fix: event type jsonschema or znull

pull/9078/head
Agusti Fernandez Pardo 2022-05-18 17:46:22 +02:00
parent a7889b3436
commit b237d71b2b
3 changed files with 6 additions and 1 deletions

View File

@ -5,5 +5,5 @@ type Literal = boolean | number | string;
type Json = Literal | { [key: string]: Json } | Json[]; type Json = Literal | { [key: string]: Json } | Json[];
const literalSchema = z.union([z.string(), z.number(), z.boolean()]); const literalSchema = z.union([z.string(), z.number(), z.boolean()]);
export const jsonSchema: z.ZodSchema<Json> = z.lazy(() => export const jsonSchema: z.ZodSchema<Json> = z.lazy(() =>
z.union([literalSchema, z.array(jsonSchema), z.record(jsonSchema)]) z.union([literalSchema, z.array(jsonSchema), z.record(jsonSchema)]).or(z.null())
); );

View File

@ -26,6 +26,7 @@ export async function WebhookById(
* /hooks/{id}: * /hooks/{id}:
* get: * get:
* summary: Find a webhook * summary: Find a webhook
* operationId: getWebhookById
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
@ -64,6 +65,7 @@ export async function WebhookById(
* /hooks/{id}: * /hooks/{id}:
* patch: * patch:
* summary: Edit an existing webhook * summary: Edit an existing webhook
* operationId: editWebhookById
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
@ -109,6 +111,7 @@ export async function WebhookById(
* /hooks/{id}: * /hooks/{id}:
* delete: * delete:
* summary: Remove an existing hook * summary: Remove an existing hook
* operationId: removeWebhookById
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id

View File

@ -16,6 +16,7 @@ async function createOrlistAllWebhooks(
* /hooks: * /hooks:
* get: * get:
* summary: Find all webhooks * summary: Find all webhooks
* operationId: listWebhooks
* tags: * tags:
* - hooks * - hooks
* externalDocs: * externalDocs:
@ -43,6 +44,7 @@ async function createOrlistAllWebhooks(
* /hooks: * /hooks:
* post: * post:
* summary: Creates a new webhook * summary: Creates a new webhook
* operationId: addWebhook
* tags: * tags:
* - webhooks * - webhooks
* externalDocs: * externalDocs: