Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

docs: tag deprecated API endpoints with the existing Legacy tag (#3838)

Lingalab9a790ef4eb7
diff --git a/docs/components/api-endpoints-table.tsx b/docs/components/api-endpoints-table.tsx
index 0b6b69003..c2553babf 100644
--- a/docs/components/api-endpoints-table.tsx
+++ b/docs/components/api-endpoints-table.tsx
@@ -1,6 +1,7 @@
'use client';
import { useApiVersion } from '@/lib/use-api-version';
+import { LegacyBadge } from '@/components/legacy-badge';
interface Endpoint {
method: string;
@@ -8,6 +9,9 @@ interface Endpoint {
pathV3: string;
summary: string;
href: string;
+ /** Set by the generator for operations flagged `deprecated` in the OpenAPI
+ * spec. Surfaced with the existing "Legacy" tag (see components/legacy-badge.tsx). */
+ legacy?: boolean;
}
/**
@@ -31,7 +35,16 @@ export function ApiEndpointsTable({ endpoints }: { endpoints: Endpoint[] }) {
return (
<tr key={i}>
<td><code>{ep.method} {path}</code></td>
- <td><a href={ep.href}>{ep.summary}</a></td>
+ <td>
+ <a href={ep.href}>{ep.summary}</a>
+ {ep.legacy && (
+ <span className="ml-2 inline-flex align-middle">
+ <LegacyBadge
+ title="Deprecated API endpoint; kept for existing integrations and may be removed in a future release"
+ />
+ </span>
+ )}
+ </td>
</tr>
);
})}
diff --git a/docs/components/legacy-badge.tsx b/docs/components/legacy-badge.tsx
index 536dc52e9..40b31c253 100644
--- a/docs/components/legacy-badge.tsx
+++ b/docs/components/legacy-badge.tsx
@@ -5,10 +5,16 @@
* the `written` frontmatter field), so a current, dated guide can show its date
* without being marked legacy.
*/
-export function LegacyBadge() {
+interface LegacyBadgeProps {
+ title?: string;
+}
+
+export function LegacyBadge({
+ title = 'Legacy: superseded by sessions; kept for existing integrations',
+}: LegacyBadgeProps) {
return (
<span
- title="Legacy: superseded by sessions; kept for existing integrations"
+ title={title}
className="not-prose inline-flex w-fit items-center gap-1.5 rounded-md border border-fd-border bg-fd-muted px-2 py-0.5 text-xs font-medium uppercase tracking-wide text-fd-muted-foreground"
>
Legacy
diff --git a/docs/content/reference/api-reference/connected-accounts/index.mdx b/docs/content/reference/api-reference/connected-accounts/index.mdx
index 01588a04c..7c5031955 100644
--- a/docs/content/reference/api-reference/connected-accounts/index.mdx
+++ b/docs/content/reference/api-reference/connected-accounts/index.mdx
@@ -30,4 +30,4 @@ Shared-connection ACL fields are experimental and nested under an `experimental`
## Endpoints
-<ApiEndpointsTable endpoints={[{"method":"POST","pathV31":"/api/v3.1/connected_accounts/{nanoid}/revoke","pathV3":"/api/v3/connected_accounts/{nanoid}/revoke","summary":"Revoke a connected account at the provider","href":"/reference/api-reference/connected-accounts/postConnectedAccountsByNanoidRevoke"},{"method":"GET","pathV31":"/api/v3.1/connected_accounts","pathV3":"/api/v3/connected_accounts","summary":"List connected accounts with optional filters","href":"/reference/api-reference/connected-accounts/getConnectedAccounts"},{"method":"POST","pathV31":"/api/v3.1/connected_accounts","pathV3":"/api/v3/connected_accounts","summary":"Create a new connected account","href":"/reference/api-reference/connected-accounts/postConnectedAccounts"},{"method":"GET","pathV31":"/api/v3.1/connected_accounts/{nanoid}","pathV3":"/api/v3/connected_accounts/{nanoid}","summary":"Get connected account details by ID","href":"/reference/api-reference/connected-accounts/getConnectedAccountsByNanoid"},{"method":"DELETE","pathV31":"/api/v3.1/connected_accounts/{nanoid}","pathV3":"/api/v3/connected_accounts/{nanoid}","summary":"Delete a connected account","href":"/reference/api-reference/connected-accounts/deleteConnectedAccountsByNanoid"},{"method":"PATCH","pathV31":"/api/v3.1/connected_accounts/{nanoid}","pathV3":"/api/v3/connected_accounts/{nanoid}","summary":"Update a connected account","href":"/reference/api-reference/connected-accounts/patchConnectedAccountsByNanoid"},{"method":"PATCH","pathV31":"/api/v3.1/connected_accounts/{nanoId}/status","pathV3":"/api/v3/connected_accounts/{nanoId}/status","summary":"Enable or disable a connected account","href":"/reference/api-reference/connected-accounts/patchConnectedAccountsByNanoIdStatus"},{"method":"POST","pathV31":"/api/v3.1/connected_accounts/{nanoid}/refresh","pathV3":"/api/v3/connected_accounts/{nanoid}/refresh","summary":"Refresh authentication for a connected account","href":"/reference/api-reference/connected-accounts/postConnectedAccountsByNanoidRefresh"},{"method":"POST","pathV31":"/api/v3.1/connected_accounts/link","pathV3":"/api/v3/connected_accounts/link","summary":"Create a new auth link session","href":"/reference/api-reference/connected-accounts/postConnectedAccountsLink"}]} />
+<ApiEndpointsTable endpoints={[{"method":"POST","pathV31":"/api/v3.1/connected_accounts/{nanoid}/revoke","pathV3":"/api/v3/connected_accounts/{nanoid}/revoke","summary":"Revoke a connected account at the provider","href":"/reference/api-reference/connected-accounts/postConnectedAccountsByNanoidRevoke"},{"method":"GET","pathV31":"/api/v3.1/connected_accounts","pathV3":"/api/v3/connected_accounts","summary":"List connected accounts with optional filters","href":"/reference/api-reference/connected-accounts/getConnectedAccounts"},{"method":"POST","pathV31":"/api/v3.1/connected_accounts","pathV3":"/api/v3/connected_accounts","summary":"Create a new connected account","href":"/reference/api-reference/connected-accounts/postConnectedAccounts"},{"method":"GET","pathV31":"/api/v3.1/connected_accounts/{nanoid}","pathV3":"/api/v3/connected_accounts/{nanoid}","summary":"Get connected account details by ID","href":"/reference/api-reference/connected-accounts/getConnectedAccountsByNanoid"},{"method":"DELETE","pathV31":"/api/v3.1/connected_accounts/{nanoid}","pathV3":"/api/v3/connected_accounts/{nanoid}","summary":"Delete a connected account","href":"/reference/api-reference/connected-accounts/deleteConnectedAccountsByNanoid"},{"method":"PATCH","pathV31":"/api/v3.1/connected_accounts/{nanoid}","pathV3":"/api/v3/connected_accounts/{nanoid}","summary":"Update a connected account","href":"/reference/api-reference/connected-accounts/patchConnectedAccountsByNanoid"},{"method":"PATCH","pathV31":"/api/v3.1/connected_accounts/{nanoId}/status","pathV3":"/api/v3/connected_accounts/{nanoId}/status","summary":"Enable or disable a connected account","href":"/reference/api-reference/connected-accounts/patchConnectedAccountsByNanoIdStatus"},{"method":"POST","pathV31":"/api/v3.1/connected_accounts/{nanoid}/refresh","pathV3":"/api/v3/connected_accounts/{nanoid}/refresh","summary":"Refresh authentication for a connected account (DEPRECATED)","href":"/reference/api-reference/connected-accounts/postConnectedAccountsByNanoidRefresh","legacy":true},{"method":"POST","pathV31":"/api/v3.1/connected_accounts/link","pathV3":"/api/v3/connected_accounts/link","summary":"Create a new auth link session","href":"/reference/api-reference/connected-accounts/postConnectedAccountsLink"}]} />
diff --git a/docs/content/reference/api-reference/files/index.mdx b/docs/content/reference/api-reference/files/index.mdx
index fa5b82fb6..92b4e54a6 100644
--- a/docs/content/reference/api-reference/files/index.mdx
+++ b/docs/content/reference/api-reference/files/index.mdx
@@ -24,4 +24,4 @@ These endpoints use your project API key in the `x-api-key` header.
## Endpoints
-<ApiEndpointsTable endpoints={[{"method":"GET","pathV31":"/api/v3.1/files/list","pathV3":"/api/v3/files/list","summary":"List files with optional app and action filters (DEPRECATED)","href":"/reference/api-reference/files/getFilesList"},{"method":"POST","pathV31":"/api/v3.1/files/upload/request","pathV3":"/api/v3/files/upload/request","summary":"Create presigned URL for request file upload to S3","href":"/reference/api-reference/files/postFilesUploadRequest"}]} />
+<ApiEndpointsTable endpoints={[{"method":"GET","pathV31":"/api/v3.1/files/list","pathV3":"/api/v3/files/list","summary":"List files with optional app and action filters (DEPRECATED)","href":"/reference/api-reference/files/getFilesList","legacy":true},{"method":"POST","pathV31":"/api/v3.1/files/upload/request","pathV3":"/api/v3/files/upload/request","summary":"Create presigned URL for request file upload to S3","href":"/reference/api-reference/files/postFilesUploadRequest"}]} />
diff --git a/docs/content/reference/v3/api-reference/connected-accounts/index.mdx b/docs/content/reference/v3/api-reference/connected-accounts/index.mdx
index 191bd0f4f..28f98c88e 100644
--- a/docs/content/reference/v3/api-reference/connected-accounts/index.mdx
+++ b/docs/content/reference/v3/api-reference/connected-accounts/index.mdx
@@ -30,4 +30,4 @@ Shared-connection ACL fields are experimental and nested under an `experimental`
## Endpoints
-<ApiEndpointsTable endpoints={[{"method":"GET","pathV31":"/api/v3.1/connected_accounts","pathV3":"/api/v3/connected_accounts","summary":"List connected accounts with optional filters","href":"/reference/v3/api-reference/connected-accounts/getConnectedAccounts"},{"method":"POST","pathV31":"/api/v3.1/connected_accounts","pathV3":"/api/v3/connected_accounts","summary":"Create a new connected account","href":"/reference/v3/api-reference/connected-accounts/postConnectedAccounts"},{"method":"GET","pathV31":"/api/v3.1/connected_accounts/{nanoid}","pathV3":"/api/v3/connected_accounts/{nanoid}","summary":"Get connected account details by ID","href":"/reference/v3/api-reference/connected-accounts/getConnectedAccountsByNanoid"},{"method":"DELETE","pathV31":"/api/v3.1/connected_accounts/{nanoid}","pathV3":"/api/v3/connected_accounts/{nanoid}","summary":"Delete a connected account","href":"/reference/v3/api-reference/connected-accounts/deleteConnectedAccountsByNanoid"},{"method":"PATCH","pathV31":"/api/v3.1/connected_accounts/{nanoid}","pathV3":"/api/v3/connected_accounts/{nanoid}","summary":"Update a connected account","href":"/reference/v3/api-reference/connected-accounts/patchConnectedAccountsByNanoid"},{"method":"PATCH","pathV31":"/api/v3.1/connected_accounts/{nanoId}/status","pathV3":"/api/v3/connected_accounts/{nanoId}/status","summary":"Enable or disable a connected account","href":"/reference/v3/api-reference/connected-accounts/patchConnectedAccountsByNanoIdStatus"},{"method":"POST","pathV31":"/api/v3.1/connected_accounts/{nanoid}/refresh","pathV3":"/api/v3/connected_accounts/{nanoid}/refresh","summary":"Refresh authentication for a connected account","href":"/reference/v3/api-reference/connected-accounts/postConnectedAccountsByNanoidRefresh"},{"method":"POST","pathV31":"/api/v3.1/connected_accounts/link","pathV3":"/api/v3/connected_accounts/link","summary":"Create a new auth link session","href":"/reference/v3/api-reference/connected-accounts/postConnectedAccountsLink"}]} />
+<ApiEndpointsTable endpoints={[{"method":"GET","pathV31":"/api/v3.1/connected_accounts","pathV3":"/api/v3/connected_accounts","summary":"List connected accounts with optional filters","href":"/reference/v3/api-reference/connected-accounts/getConnectedAccounts"},{"method":"POST","pathV31":"/api/v3.1/connected_accounts","pathV3":"/api/v3/connected_accounts","summary":"Create a new connected account","href":"/reference/v3/api-reference/connected-accounts/postConnectedAccounts"},{"method":"GET","pathV31":"/api/v3.1/connected_accounts/{nanoid}","pathV3":"/api/v3/connected_accounts/{nanoid}","summary":"Get connected account details by ID","href":"/reference/v3/api-reference/connected-accounts/getConnectedAccountsByNanoid"},{"method":"DELETE","pathV31":"/api/v3.1/connected_accounts/{nanoid}","pathV3":"/api/v3/connected_accounts/{nanoid}","summary":"Delete a connected account","href":"/reference/v3/api-reference/connected-accounts/deleteConnectedAccountsByNanoid"},{"method":"PATCH","pathV31":"/api/v3.1/connected_accounts/{nanoid}","pathV3":"/api/v3/connected_accounts/{nanoid}","summary":"Update a connected account","href":"/reference/v3/api-reference/connected-accounts/patchConnectedAccountsByNanoid"},{"method":"PATCH","pathV31":"/api/v3.1/connected_accounts/{nanoId}/status","pathV3":"/api/v3/connected_accounts/{nanoId}/status","summary":"Enable or disable a connected account","href":"/reference/v3/api-reference/connected-accounts/patchConnectedAccountsByNanoIdStatus"},{"method":"POST","pathV31":"/api/v3.1/connected_accounts/{nanoid}/refresh","pathV3":"/api/v3/connected_accounts/{nanoid}/refresh","summary":"Refresh authentication for a connected account (DEPRECATED)","href":"/reference/v3/api-reference/connected-accounts/postConnectedAccountsByNanoidRefresh","legacy":true},{"method":"POST","pathV31":"/api/v3.1/connected_accounts/link","pathV3":"/api/v3/connected_accounts/link","summary":"Create a new auth link session","href":"/reference/v3/api-reference/connected-accounts/postConnectedAccountsLink"}]} />
diff --git a/docs/content/reference/v3/api-reference/files/index.mdx b/docs/content/reference/v3/api-reference/files/index.mdx
index c30171782..f7a750bb1 100644
--- a/docs/content/reference/v3/api-reference/files/index.mdx
+++ b/docs/content/reference/v3/api-reference/files/index.mdx
@@ -24,4 +24,4 @@ These endpoints use your project API key in the `x-api-key` header.
## Endpoints
-<ApiEndpointsTable endpoints={[{"method":"GET","pathV31":"/api/v3.1/files/list","pathV3":"/api/v3/files/list","summary":"List files with optional app and action filters (DEPRECATED)","href":"/reference/v3/api-reference/files/getFilesList"},{"method":"POST","pathV31":"/api/v3.1/files/upload/request","pathV3":"/api/v3/files/upload/request","summary":"Create presigned URL for request file upload to S3","href":"/reference/v3/api-reference/files/postFilesUploadRequest"}]} />
+<ApiEndpointsTable endpoints={[{"method":"GET","pathV31":"/api/v3.1/files/list","pathV3":"/api/v3/files/list","summary":"List files with optional app and action filters (DEPRECATED)","href":"/reference/v3/api-reference/files/getFilesList","legacy":true},{"method":"POST","pathV31":"/api/v3.1/files/upload/request","pathV3":"/api/v3/files/upload/request","summary":"Create presigned URL for request file upload to S3","href":"/reference/v3/api-reference/files/postFilesUploadRequest"}]} />
diff --git a/docs/public/openapi-v3.json b/docs/public/openapi-v3.json
index 840e339a0..ebf101169 100644
--- a/docs/public/openapi-v3.json
+++ b/docs/public/openapi-v3.json
@@ -4807,8 +4807,9 @@
},
"/api/v3/connected_accounts/{nanoid}/refresh": {
"post": {
- "summary": "Refresh authentication for a connected account",
- "description": "Initiates a new authentication flow for a connected account when credentials have expired or become invalid. This may generate a new authentication URL for OAuth flows or refresh tokens for other auth schemes.",
+ "summary": "Refresh authentication for a connected account (DEPRECATED)",
+ "description": "DEPRECATED: Manual refresh of a connected account is deprecated. Composio automatically refreshes credentials in the background as they approach expiry, so this endpoint is no longer required and may be removed in a future release. Initiates a new authentication flow for a connected account when credentials have expired or become invalid. This may generate a new authentication URL for OAuth flows or refresh tokens for other auth schemes.",
+ "deprecated": true,
"tags": [
"Connected Accounts"
],
diff --git a/docs/public/openapi.json b/docs/public/openapi.json
index f9c65bccf..bc007624f 100644
--- a/docs/public/openapi.json
+++ b/docs/public/openapi.json
@@ -14264,8 +14264,9 @@
},
"/api/v3.1/connected_accounts/{nanoid}/refresh": {
"post": {
- "summary": "Refresh authentication for a connected account",
- "description": "Initiates a new authentication flow for a connected account when credentials have expired or become invalid. This may generate a new authentication URL for OAuth flows or refresh tokens for other auth schemes.",
+ "summary": "Refresh authentication for a connected account (DEPRECATED)",
+ "description": "DEPRECATED: Manual refresh of a connected account is deprecated. Composio automatically refreshes credentials in the background as they approach expiry, so this endpoint is no longer required and may be removed in a future release. Initiates a new authentication flow for a connected account when credentials have expired or become invalid. This may generate a new authentication URL for OAuth flows or refresh tokens for other auth schemes.",
+ "deprecated": true,
"tags": [
"Connected Accounts"
],
diff --git a/docs/scripts/generate-api-index.ts b/docs/scripts/generate-api-index.ts
index f96fb5873..af752b8d6 100644
--- a/docs/scripts/generate-api-index.ts
+++ b/docs/scripts/generate-api-index.ts
@@ -31,6 +31,7 @@ interface OpenAPIOperation {
tags?: string[];
description?: string;
operationId?: string;
+ deprecated?: boolean;
'x-api-version'?: string;
}
@@ -44,6 +45,7 @@ interface OperationEntry {
method: string;
path: string;
operationId: string;
+ deprecated: boolean;
}
function slugify(text: string): string {
@@ -85,6 +87,7 @@ function getOperationsByTag(spec: OpenAPISpec): Record<string, OperationEntry[]>
method: method.toUpperCase(),
path,
operationId: operation.operationId || slugify(operation.summary || path),
+ deprecated: operation.deprecated === true,
});
}
}
@@ -216,6 +219,10 @@ function generateIndexPages() {
pathV3: v3Op ? v3Op.path : op.path.replace('/v3.1/', '/v3/'),
summary: op.summary,
href: `/reference/api-reference/${tagSlug}/${op.operationId}`,
+ // OpenAPI marks these `deprecated`; we surface them with the existing
+ // "Legacy" tag rather than a separate one. Only emitted when true so
+ // non-legacy pages stay byte-identical.
+ ...(op.deprecated ? { legacy: true } : {}),
};
});
@@ -247,6 +254,10 @@ ${body}
pathV3: op.path,
summary: op.summary,
href: `/reference/v3/api-reference/${tagSlug}/${op.operationId}`,
+ // OpenAPI marks these `deprecated`; we surface them with the existing
+ // "Legacy" tag rather than a separate one. Only emitted when true so
+ // non-legacy pages stay byte-identical.
+ ...(op.deprecated ? { legacy: true } : {}),
}));
const v3Content = `---
diff --git a/docs/tests/static/api-deprecation.test.tsx b/docs/tests/static/api-deprecation.test.tsx
new file mode 100644
index 000000000..e45e35e3d
--- /dev/null
+++ b/docs/tests/static/api-deprecation.test.tsx
@@ -0,0 +1,172 @@
+import { afterEach, describe, expect, mock, test } from "bun:test";
+import { mkdtemp, mkdir, readFile, rm, writeFile } from "fs/promises";
+import { tmpdir } from "os";
+import { join } from "path";
+import { renderToStaticMarkup } from "react-dom/server";
+
+mock.module("next/navigation", () => ({
+ usePathname: () => "/reference/api-reference/tasks",
+}));
+
+const { ApiEndpointsTable } = await import("../../components/api-endpoints-table");
+
+const DOCS_DIR = join(import.meta.dir, "../..");
+const GENERATOR_PATH = join(DOCS_DIR, "scripts/generate-api-index.ts");
+const fixtureDirectories: string[] = [];
+
+interface SerializedEndpoint {
+ method: string;
+ pathV31: string;
+ pathV3: string;
+ summary: string;
+ href: string;
+ legacy?: boolean;
+}
+
+function createSpec(version: "v3.1" | "v3") {
+ return {
+ tags: [{ name: "Tasks", description: "Task endpoints" }],
+ paths: {
+ [`/${version}/tasks/deprecated`]: {
+ get: {
+ tags: ["Tasks"],
+ summary: "Deprecated task endpoint",
+ operationId: "getDeprecatedTask",
+ deprecated: true,
+ },
+ },
+ [`/${version}/tasks/active`]: {
+ post: {
+ tags: ["Tasks"],
+ summary: "Active task endpoint",
+ operationId: "createTask",
+ },
+ },
+ },
+ };
+}
+
+function parseEndpoints(content: string): SerializedEndpoint[] {
+ const prefix = "<ApiEndpointsTable endpoints={";
+ const start = content.indexOf(prefix);
+ const end = content.indexOf("} />", start);
+
+ expect(start).toBeGreaterThanOrEqual(0);
+ expect(end).toBeGreaterThan(start);
+
+ return JSON.parse(content.slice(start + prefix.length, end));
+}
+
+function expectedEndpoints(hrefPrefix: string): SerializedEndpoint[] {
+ return [
+ {
+ method: "GET",
+ pathV31: "/v3.1/tasks/deprecated",
+ pathV3: "/v3/tasks/deprecated",
+ summary: "Deprecated task endpoint",
+ href: `${hrefPrefix}/tasks/getDeprecatedTask`,
+ legacy: true,
+ },
+ {
+ method: "POST",
+ pathV31: "/v3.1/tasks/active",
+ pathV3: "/v3/tasks/active",
+ summary: "Active task endpoint",
+ href: `${hrefPrefix}/tasks/createTask`,
+ },
+ ];
+}
+
+async function generateFixture(): Promise<string> {
+ const fixtureDir = await mkdtemp(join(tmpdir(), "composio-api-index-"));
+ fixtureDirectories.push(fixtureDir);
+
+ await mkdir(join(fixtureDir, "public"), { recursive: true });
+ await writeFile(
+ join(fixtureDir, "public/openapi.json"),
+ JSON.stringify(createSpec("v3.1")),
+ );
+ await writeFile(
+ join(fixtureDir, "public/openapi-v3.json"),
+ JSON.stringify(createSpec("v3")),
+ );
+
+ const process = Bun.spawn([Bun.argv[0], GENERATOR_PATH], {
+ cwd: fixtureDir,
+ stdout: "pipe",
+ stderr: "pipe",
+ });
+ const [exitCode, stderr] = await Promise.all([
+ process.exited,
+ new Response(process.stderr).text(),
+ ]);
+
+ if (exitCode !== 0) {
+ throw new Error(`API index generator failed with exit code ${exitCode}: ${stderr}`);
+ }
+
+ return fixtureDir;
+}
+
+afterEach(async () => {
+ await Promise.all(
+ fixtureDirectories.splice(0).map(path => rm(path, { recursive: true })),
+ );
+});
+
+describe("deprecated API endpoints", () => {
+ test("serializes legacy only for deprecated v3.1 and v3 operations", async () => {
+ const fixtureDir = await generateFixture();
+ const v31Content = await readFile(
+ join(fixtureDir, "content/reference/api-reference/tasks/index.mdx"),
+ "utf-8",
+ );
+ const v3Content = await readFile(
+ join(fixtureDir, "content/reference/v3/api-reference/tasks/index.mdx"),
+ "utf-8",
+ );
+
+ const v31Endpoints = parseEndpoints(v31Content);
+ const v3Endpoints = parseEndpoints(v3Content);
+
+ expect(v31Endpoints).toEqual(expectedEndpoints("/reference/api-reference"));
+ expect(v3Endpoints).toEqual(expectedEndpoints("/reference/v3/api-reference"));
+
+ for (const endpoints of [v31Endpoints, v3Endpoints]) {
+ expect(
+ endpoints.find(endpoint => endpoint.summary === "Active task endpoint"),
+ ).not.toHaveProperty("legacy");
+ }
+ });
+
+ test("renders one Legacy badge for a deprecated endpoint and none for an active endpoint", () => {
+ const html = renderToStaticMarkup(
+ <ApiEndpointsTable
+ endpoints={[
+ {
+ method: "GET",
+ pathV31: "/v3.1/tasks/deprecated",
+ pathV3: "/v3/tasks/deprecated",
+ summary: "Deprecated task endpoint",
+ href: "/reference/api-reference/tasks/getDeprecatedTask",
+ legacy: true,
+ },
+ {
+ method: "POST",
+ pathV31: "/v3.1/tasks/active",
+ pathV3: "/v3/tasks/active",
+ summary: "Active task endpoint",
+ href: "/reference/api-reference/tasks/createTask",
+ },
+ ]}
+ />,
+ );
+
+ expect(
+ html.match(
+ /title="Deprecated API endpoint; kept for existing integrations and may be removed in a future release"/g,
+ ),
+ ).toHaveLength(1);
+ expect(html.match(/>Legacy<\/span>/g)).toHaveLength(1);
+ });
+});