Merge pull request #79 from calcom/fix/event-validations

fix: event type jsonschema or znull
This commit is contained in:
Agusti Fernandez Pardo
2022-05-18 17:51:48 +02:00
committed by GitHub
3 changed files with 6 additions and 1 deletions
+1 -1
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())
);
+3
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
+2
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: