2022-04-03 15:47:18 +00:00
|
|
|
import jsonSchema from "@/json-schema/json-schema.json";
|
2022-03-31 20:14:37 +00:00
|
|
|
import pjson from "@/package.json";
|
2022-03-30 14:56:24 +00:00
|
|
|
import { withSwagger } from "next-swagger-doc";
|
|
|
|
|
|
|
|
const swaggerHandler = withSwagger({
|
|
|
|
definition: {
|
|
|
|
openapi: "3.0.0",
|
2022-04-26 19:56:59 +00:00
|
|
|
servers: [
|
|
|
|
{ url: "https://api.cal.com/v1" },
|
|
|
|
{ url: "https://api.cal.dev/v1" },
|
|
|
|
{ url: "http://localhost:3002/v1" },
|
|
|
|
],
|
|
|
|
externalDocs: {
|
|
|
|
url: "https://docs.cal.com",
|
|
|
|
description: "Find more info at our main docs: https://docs.cal.com/",
|
|
|
|
},
|
2022-03-30 14:56:24 +00:00
|
|
|
info: {
|
2022-03-31 20:14:37 +00:00
|
|
|
title: `${pjson.name}: ${pjson.description}`,
|
|
|
|
version: pjson.version,
|
2022-03-30 14:56:24 +00:00
|
|
|
},
|
2022-04-17 14:18:42 +00:00
|
|
|
components: {
|
|
|
|
securitySchemes: { ApiKeyAuth: { type: "apiKey", in: "query", name: "apiKey" } },
|
|
|
|
},
|
2022-04-29 17:45:33 +00:00
|
|
|
security: [{ ApiKeyAuth: [] }],
|
2022-03-30 14:56:24 +00:00
|
|
|
},
|
|
|
|
apiFolder: "pages/api",
|
|
|
|
});
|
2022-04-15 15:29:03 +00:00
|
|
|
export default swaggerHandler();
|