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 the specs

Kiran K880c792b10a5
diff --git a/apps/web/app/api/openapi/route.ts b/apps/web/app/api/openapi/route.ts
index 45ad1dc659..89726be824 100644
--- a/apps/web/app/api/openapi/route.ts
+++ b/apps/web/app/api/openapi/route.ts
@@ -1,6 +1,8 @@
import { NextResponse } from "next/server";
-import { openAPIDocument } from "@/lib/openapi";
+import { createDocument } from "zod-openapi";
+
+import { openApiObject } from "@/lib/openapi";
export const GET = async () => {
- return NextResponse.json(openAPIDocument);
+ return NextResponse.json(createDocument(openApiObject));
};
diff --git a/apps/web/lib/openapi/index.ts b/apps/web/lib/openapi/index.ts
index e153383d70..70d1cf19c0 100644
--- a/apps/web/lib/openapi/index.ts
+++ b/apps/web/lib/openapi/index.ts
@@ -1,4 +1,4 @@
-import { createDocument } from "zod-openapi";
+import { ZodOpenApiObject, createDocument } from "zod-openapi";
import { linksPaths } from "./links";
import { tagsPaths } from "./tags";
@@ -7,7 +7,7 @@ import { LinkSchema } from "@/lib/zod/schemas/links";
import { TagSchema } from "@/lib/zod/schemas/tags";
import { ProjectSchema } from "@/lib/zod/schemas/projects";
-export const openAPIDocument = createDocument({
+export const openApiObject: ZodOpenApiObject = {
openapi: "3.0.3",
info: {
title: "Dub.co API",
@@ -49,4 +49,4 @@ export const openAPIDocument = createDocument({
},
},
},
-});
\ No newline at end of file
+};