cal.pub0.org/pages/api/docs.ts

20 lines
545 B
TypeScript
Raw Normal View History

import jsonSchema from "@/json-schema/json-schema.json";
import pjson from "@/package.json";
import { withSwagger } from "next-swagger-doc";
const swaggerHandler = withSwagger({
definition: {
openapi: "3.0.0",
info: {
title: `${pjson.name}: ${pjson.description}`,
version: pjson.version,
},
components: { schemas: { ...jsonSchema.definitions } },
definitions: jsonSchema.definitions,
},
apiFolder: "pages/api",
tags: ["users", "teams", "memeberships"],
sort: true,
});
export default swaggerHandler();