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