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[];
const literalSchema = z.union([z.string(), z.number(), z.boolean()]);
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}:
* get:
* summary: Find a webhook
* operationId: getWebhookById
* parameters:
* - in: path
* name: id
@ -64,6 +65,7 @@ export async function WebhookById(
* /hooks/{id}:
* patch:
* summary: Edit an existing webhook
* operationId: editWebhookById
* parameters:
* - in: path
* name: id
@ -109,6 +111,7 @@ export async function WebhookById(
* /hooks/{id}:
* delete:
* summary: Remove an existing hook
* operationId: removeWebhookById
* parameters:
* - in: path
* name: id

View File

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