Examples
This library is made to be used through an integration with your favorite framework but you can as well use it directly as a document generator.
Express
ts
import from "express";
import { } from "openapi-metadata";
import { } from "openapi-metadata/ui";
const = ();
const = await (yourConfiguration);
.get("/api", async (, ) => {
.send(.());
});
.get("/api/docs", (, ) => {
const = ("/api");
.send();
});
Fastify
ts
import from "fastify";
import { } from "openapi-metadata";
import { } from "openapi-metadata/ui";
const = Fastify();
const = await (yourConfiguration);
.get("/api", async () => {
return ;
});
.get("/api/docs", () => {
const = ("/api");
return ;
});