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.

Update metaTagsSchema in metatags.ts and index.ts

Kiran K2d21f3706b0c
diff --git a/apps/web/lib/openapi/metatags/index.ts b/apps/web/lib/openapi/metatags/index.ts
index 7217b63b46..7ada191aa2 100644
--- a/apps/web/lib/openapi/metatags/index.ts
+++ b/apps/web/lib/openapi/metatags/index.ts
@@ -23,28 +23,7 @@ const getMetatags: ZodOpenApiOperationObject = {
description: "The retrieved metatags",
content: {
"application/json": {
- schema: z.object({
- title: z
- .string()
- .nullable()
- .describe("The meta title tag for the URL.")
- .openapi({
- example: "Dub.co - Link Management for Modern Marketing Teams",
- }),
- description: z
- .string()
- .nullable()
- .describe("The meta description tag for the URL.")
- .openapi({
- example:
- "Dub.co is the open-source link management infrastructure ...",
- }),
- image: z
- .string()
- .nullable()
- .describe("The OpenGraph image for the URL.")
- .openapi({ example: "https://assets.dub.co/thumbnail.jpg" }),
- }),
+ schema: metaTagsSchema,
},
},
},
diff --git a/apps/web/lib/zod/schemas/metatags.ts b/apps/web/lib/zod/schemas/metatags.ts
index 42abffc375..cb7280f27c 100644
--- a/apps/web/lib/zod/schemas/metatags.ts
+++ b/apps/web/lib/zod/schemas/metatags.ts
@@ -1,10 +1,23 @@
import z from "@/lib/zod";
export const metaTagsSchema = z.object({
- title: z.string().nullable().describe("The meta title tag for the URL"),
+ title: z
+ .string()
+ .nullable()
+ .describe("The meta title tag for the URL.")
+ .openapi({
+ example: "Dub.co - Link Management for Modern Marketing Teams",
+ }),
description: z
.string()
.nullable()
- .describe("The meta description tag for the URL"),
- image: z.string().nullable().describe("The OpenGraph image for the URL"),
+ .describe("The meta description tag for the URL.")
+ .openapi({
+ example: "Dub.co is the open-source link management infrastructure ...",
+ }),
+ image: z
+ .string()
+ .nullable()
+ .describe("The OpenGraph image for the URL.")
+ .openapi({ example: "https://assets.dub.co/thumbnail.jpg" }),
});
diff --git a/apps/web/tests/utils/env.ts b/apps/web/tests/utils/env.ts
index d8329ad8a2..8f584574dc 100644
--- a/apps/web/tests/utils/env.ts
+++ b/apps/web/tests/utils/env.ts
@@ -6,4 +6,4 @@ export const integrationTestEnv = z.object({
// WORKSPACE_ID: z.string().min(1),
// WORKSPACE_SLUG: z.string().min(1),
USER_ID: z.string().min(1),
-});
\ No newline at end of file
+});