support --options flag in generate-swagger
Checklist
- [x] run
npm run testandnpm run benchmark - [ ] tests and/or benchmarks are included
- [ ] documentation is changed or added
- [x] commit message and code follows the Developer's Certification of Origin and the Code of conduct
Oh gosh, please write a comprehensive PR description next time
This fix relates to #687 and it propagates the same fix to the
generate swaggercommand because if you writegenerate-swagger --optionsit is ignored.It is not clear to me why this option is needed: this command spins up a fastify (without listening) and it generates the swagger. Whatever hooks and additional configurations should not matter.
Could you help me with an example? In case, could you add a test in the
test/generate-swagger.test.jsfile?
Sure, I have custom keywords defined for the ajv schemas I use. In order for the generate-swagger command to work I need to pass ajv options to fastify. Without this the schemas fail validation and the swagger output fails to generate.
Ok, thanks for helping me
Would you mind to add a test? Without it we can't garantee to remove this feature accidentally in future