Closed ronaldl29 closed 4 months ago
Check this out.
$ npx swagger-jsdoc
Usage: swagger-jsdoc [options] <path ...>
Options:
-V, --version output the version number
-d, --definition <swaggerDefinition.js> Input swagger definition.
-o, --output [swaggerSpec.json] Output swagger specification.
-h, --help display help for command
# $ npx swagger-jsdoc -d <<definition-file>> -o swagger.json <<your-api-entry-point>>
$ npx swagger-jsdoc -d swagger.js -o swagger.json index.js
while running it can be done like this:
import { writeFile } from 'fs/promises';
writeFile('swagger.json', JSON.stringify(openapiSpecification, null, 2), 'utf-8');
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I am loading my *.routes.api.js files like this:
I would like to export this to a swagger.json file. Is it possible with this package?