Generates swagger/openapi specification based on jsDoc comments and YAML files.
The first 7.x release. It's a major refactoring of v6 reaching 100% test coverage and a few major changes on the way:
Written in ESM instead of CommonJS
CLI has been moved to be an example => breaking change and a need for the user to create a CLI. Reason: too many varying requests for changes in the CLI which was based on commander. The module loading utility has been left in the examples' folder together with tests, so migration should be very straight-forward to your preferred CLI package. Library authors have already made alternative CLIs in parallel such https://github.com/lmammino/swagger-jsdoc-generator
The main function is now returning a promise. It's because during the rewrite, many sync functions have been changed to promises, especially file reading operations. This change can be considered as imminent as other features in the future will also require it to be async.
Update documentation
Fixes a repeated regression reported in https://github.com/Surnet/swagger-jsdoc/issues/244
Remove confusing message from CLI about missing API files https://github.com/Surnet/swagger-jsdoc/pull/241
Fixes regressions reported in https://github.com/Surnet/swagger-jsdoc/issues/237
No major changes since last release candidate. Rather, just a pre-new-year release.
Please see this blog post for changes overview.
Support for x-webhooks
. See the original request for details on this extension.
This change affects only the CLI and can be a breaking one if you pass apis
information through the swaggerDefinition/openAPIObject. The change no longer reads apis
property from that object, as it's not part of the OpenAPI specification.
See the pull request for more details https://github.com/Surnet/swagger-jsdoc/pull/234
Example swaggerDefinition.js
:
{
"info": {
"title": "Hello World",
"version": "1.0.0",
"description": "A sample API"
},
- "apis": ["./**/*/routes.js"]
}
Pass this information as input files parameter:
swagger-jsdoc -d swaggerDefinition.js ./**/*/routes.js
Adds support for custom encoding requested in https://github.com/Surnet/swagger-jsdoc/issues/206