cal.pub0.org/apps/swagger/pages/index.tsx

27 lines
828 B
TypeScript
Raw Permalink Normal View History

import dynamic from "next/dynamic";
import type { SwaggerUI } from "swagger-ui-react";
2022-04-19 08:50:40 +00:00
import { SnippedGenerator, requestSnippets } from "@lib/snippets";
const SwaggerUIDynamic: SwaggerUI & { url: string } = dynamic(() => import("swagger-ui-react"), {
ssr: false,
});
export default function APIDocs() {
return (
<SwaggerUIDynamic
2022-04-19 08:50:40 +00:00
url={process.env.NEXT_PUBLIC_SWAGGER_DOCS_URL || "https://api.cal.com/docs"}
persistAuthorization={true}
supportedSubmitMethods={["get", "post", "delete", "put", "options", "patch"]}
requestSnippetsEnabled={true}
2022-04-19 08:50:40 +00:00
requestSnippets={requestSnippets}
plugins={[SnippedGenerator]}
tryItOutEnabled={true}
syntaxHighlight={true}
enableCORS={false} // Doesn't seem to work either
docExpansion="list"
filter={true}
/>
);
}