fix: use createOpenAPIPage from fumadocs-openapi

This commit is contained in:
2026-07-12 16:55:34 -04:00
parent 5cf0293220
commit 0d0256134c
2 changed files with 20 additions and 5 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
"use client"; "use client";
import { defineClientConfig } from "fumadocs-openapi/ui/client"; import { createOpenAPIPage } from "fumadocs-openapi/ui";
export default defineClientConfig({}); export const OpenAPIPage = createOpenAPIPage({});
+18 -3
View File
@@ -1,7 +1,22 @@
import { createAPIPage } from "fumadocs-openapi/ui"; import type { OpenAPIPageProps_Preloaded } from "fumadocs-openapi/ui";
import { openapi } from "@/lib/openapi"; import { openapi } from "@/lib/openapi";
import client from "./api-page.client"; import { OpenAPIPage } from "./api-page.client";
export const APIPage = createAPIPage(openapi, { client }); type APIPageProps = Omit<OpenAPIPageProps_Preloaded, "preloaded">;
export async function APIPage(props: APIPageProps) {
const { document, ...pageProps } = props;
const { bundled } = await openapi.getSchema(document);
return (
<OpenAPIPage
{...pageProps}
payload={{
bundled,
proxyUrl: openapi.options.proxyUrl,
}}
/>
);
}