fix: event type jsonschema or znull
parent
a7889b3436
commit
b237d71b2b
|
@ -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())
|
||||
);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue