UNPKG

fastify-openapi-glue

Version:

generate a fastify configuration from an openapi specification

24 lines (20 loc) 609 B
// Fastify plugin autogenerated by fastify-openapi-glue import openapiGlue from "../../lib/templates/index.js"; import { Security } from "./security.js"; import { Service } from "./service.js"; const localFile = (fileName) => new URL(fileName, import.meta.url).pathname; 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, }, }, };