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.

Speakeasy doc customization

Kiran K6e1df026e726
diff --git a/apps/web/lib/openapi/index.ts b/apps/web/lib/openapi/index.ts
index c6d08980c3..3ad180eb62 100644
--- a/apps/web/lib/openapi/index.ts
+++ b/apps/web/lib/openapi/index.ts
@@ -51,6 +51,7 @@ export const openApiObject: ZodOpenApiObject = {
type: "http",
description: "Default authentication mechanism",
scheme: "bearer",
+ "x-speakeasy-example": "DUB_API_KEY",
},
},
responses: {
diff --git a/apps/web/lib/openapi/links/create-link.ts b/apps/web/lib/openapi/links/create-link.ts
index 008ff1cf39..348ecc1e45 100644
--- a/apps/web/lib/openapi/links/create-link.ts
+++ b/apps/web/lib/openapi/links/create-link.ts
@@ -6,6 +6,7 @@ import { workspaceParamsSchema } from "../request";
export const createLink: ZodOpenApiOperationObject = {
operationId: "createLink",
"x-speakeasy-name-override": "create",
+ "x-speakeasy-usage-example": true,
summary: "Create a new link",
description: "Create a new link for the authenticated workspace.",
requestParams: {
diff --git a/apps/web/lib/openapi/request.ts b/apps/web/lib/openapi/request.ts
index 30ad4093af..dc18d7a41d 100644
--- a/apps/web/lib/openapi/request.ts
+++ b/apps/web/lib/openapi/request.ts
@@ -1,7 +1,10 @@
import z from "../zod";
export const workspaceParamsSchema = z.object({
- workspaceId: z.string().describe("The ID of the workspace."),
+ workspaceId: z
+ .string()
+ .describe("The ID of the workspace.")
+ .openapi({ example: "ws_cluuwcv0r..." }),
projectSlug: z
.string()
.optional()
diff --git a/apps/web/lib/zod/schemas/links.ts b/apps/web/lib/zod/schemas/links.ts
index 0f86edb48c..f5cd64b729 100644
--- a/apps/web/lib/zod/schemas/links.ts
+++ b/apps/web/lib/zod/schemas/links.ts
@@ -129,7 +129,11 @@ export const createLinkBodySchema = z.object({
.describe(
"The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided.",
),
- url: parseUrlSchema.describe("The destination URL of the short link."),
+ url: parseUrlSchema
+ .describe("The destination URL of the short link.")
+ .openapi({
+ example: "https://google/com",
+ }),
archived: z
.boolean()
.optional()
@@ -151,7 +155,8 @@ export const createLinkBodySchema = z.object({
.union([z.string(), z.array(z.string())])
.transform((v) => (Array.isArray(v) ? v : v.split(",")))
.optional()
- .describe("The unique IDs of the tags assigned to the short link."),
+ .describe("The unique IDs of the tags assigned to the short link.")
+ .openapi({ example: ["clux0rgak00011..."] }),
comments: z.string().nullish().describe("The comments for the short link."),
expiresAt: z
.string()