
* fix: adds servers in openapi, remove hack in snippets, update deps, make dynamic import to use latests swagger ui deps * fix: remove unneded import * fix: adds yarn dev commands for api and swagger * fix: prisma not web before api * fix: improve mobile docs api * fix request snippets * fix: custom more visible scrollbar for snippets in moible * fix: remove comments and ugly scrollbar * fix: types and remove lib url * fix: install iframe-react-resizer in docs * fix: remove web scope from yarn dev:api * fix: remove json-schema autogenerated as wont be used * fix: apiKeyAuth * fix: swagger patch thx hariom * fix: add api to env/example Co-authored-by: Agusti Fernandez Pardo <git@agusti.me> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: zomars <zomars@me.com>
26 lines
823 B
TypeScript
26 lines
823 B
TypeScript
import dynamic from "next/dynamic";
|
|
import { SwaggerUI } from "swagger-ui-react";
|
|
|
|
import { SnippedGenerator, requestSnippets } from "@lib/snippets";
|
|
|
|
const SwaggerUIDynamic: SwaggerUI & { url: string } = dynamic(() => import("swagger-ui-react"), {
|
|
ssr: false,
|
|
});
|
|
|
|
export default function APIDocs() {
|
|
return (
|
|
<SwaggerUIDynamic
|
|
url={process.env.NEXT_PUBLIC_SWAGGER_DOCS_URL || "https://api.cal.com/docs"}
|
|
persistAuthorization={true}
|
|
supportedSubmitMethods={["get", "post", "delete", "put", "options", "patch"]}
|
|
requestSnippetsEnabled={true}
|
|
requestSnippets={requestSnippets}
|
|
plugins={[SnippedGenerator]}
|
|
tryItOutEnabled={true}
|
|
syntaxHighlight={true}
|
|
enableCORS={false} // Doesn't seem to work either
|
|
docExpansion="list"
|
|
filter={true}
|
|
/>
|
|
);
|
|
}
|