fastify-openapi-glue
Version:
generate a fastify configuration from an openapi specification
26 lines (21 loc) • 623 B
JavaScript
// Fastify plugin autogenerated by fastify-openapi-glue
import path from "node:path";
import openapiGlue from "../../index.js";
import { Security } from "./security.js";
import { Service } from "./service.js";
const localFile = (fileName) => path.join(import.meta.dirname, fileName);
const pluginOptions = {
specification: localFile("./openApi.json"),
serviceHandlers: new Service(),
securityHandlers: new Security(),
};
export default async function (fastify, opts) {
fastify.register(openapiGlue, { ...pluginOptions, ...opts });
}
export const options = {
ajv: {
customOptions: {
strict: false,
},
},
};