diff --git a/examples/generated-javascript-project/index.js b/examples/generated-javascript-project/index.js index 56ae86a..15c0415 100644 --- a/examples/generated-javascript-project/index.js +++ b/examples/generated-javascript-project/index.js @@ -11,7 +11,7 @@ const pluginOptions = { }; export default async function (fastify, opts) { - fastify.register(openapiGlue, pluginOptions); + fastify.register(openapiGlue, { ...pluginOptions, ...opts }); } export const options = { diff --git a/lib/templates/js/index.js b/lib/templates/js/index.js index 6c1bfd6..a900bec 100644 --- a/lib/templates/js/index.js +++ b/lib/templates/js/index.js @@ -1,4 +1,5 @@ -export default (data) => `// Fastify plugin autogenerated by fastify-openapi-glue +export default (data) => + `// Fastify plugin autogenerated by fastify-openapi-glue import openapiGlue from "${data.pluginPackageName}"; import { Security } from "./${data.securityFile}"; import { Service } from "./${data.serviceFile}"; @@ -11,7 +12,7 @@ const pluginOptions = { }; export default async function (fastify, opts) { - fastify.register(openapiGlue, pluginOptions); + fastify.register(openapiGlue, { ...pluginOptions, ...opts }); } export const options = { diff --git a/test/test-swagger-noBasePath.v2.javascript.checksums.json b/test/test-swagger-noBasePath.v2.javascript.checksums.json index 78c2695..923a0e8 100644 --- a/test/test-swagger-noBasePath.v2.javascript.checksums.json +++ b/test/test-swagger-noBasePath.v2.javascript.checksums.json @@ -14,7 +14,7 @@ }, "plugin": { "fileName": "index.js", - "checksum": "87d81a605881e6ba5d6af1266c3fcc30f95b6441290811bb1e5b7e1ce9940cfe" + "checksum": "aaf6dbb034952530335e39a4a48f1b0ac065d00072d0d6156489391de8721451" }, "readme": { "fileName": "README.md", diff --git a/test/test-swagger.v2.javascript.checksums.json b/test/test-swagger.v2.javascript.checksums.json index 89595f2..2d6ac3c 100644 --- a/test/test-swagger.v2.javascript.checksums.json +++ b/test/test-swagger.v2.javascript.checksums.json @@ -14,7 +14,7 @@ }, "plugin": { "fileName": "index.js", - "checksum": "87d81a605881e6ba5d6af1266c3fcc30f95b6441290811bb1e5b7e1ce9940cfe" + "checksum": "aaf6dbb034952530335e39a4a48f1b0ac065d00072d0d6156489391de8721451" }, "readme": { "fileName": "README.md",