Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Fix events SDK (`z.union` → `z.discriminatedUnion`)

Steven Tey324ac14c0633
diff --git a/apps/web/lib/openapi/events/index.ts b/apps/web/lib/openapi/events/index.ts
index 4d18e5a770..f686468469 100644
--- a/apps/web/lib/openapi/events/index.ts
+++ b/apps/web/lib/openapi/events/index.ts
@@ -20,11 +20,13 @@ export const listEvents: ZodOpenApiOperationObject = {
description: "A list of events",
content: {
"application/json": {
- schema: z.union([
- z.array(clickEventResponseSchema).openapi({ title: "ClickEvents" }),
- z.array(leadEventResponseSchema).openapi({ title: "LeadEvents" }),
- z.array(saleEventResponseSchema).openapi({ title: "SaleEvents" }),
- ]),
+ schema: z.array(
+ z.discriminatedUnion("event", [
+ clickEventResponseSchema,
+ leadEventResponseSchema,
+ saleEventResponseSchema,
+ ]),
+ ),
},
},
},