Surnet / swagger-jsdoc

Generates swagger/openapi specification based on jsDoc comments and YAML files.
MIT License
1.66k stars 224 forks source link

I would like to be able to pass a flag to the cli tool to fail if errors are found #370

Open vidhill opened 11 months ago

vidhill commented 11 months ago

Is your feature request related to a problem? Please describe.

We are using the swagger-jsdoc cli in an npm script

e.g.

npx swagger-jsdoc -d definition.js -o api-docs.json index.js

If the scan fails the process exits with a code 0 which indicates success

When running on CICD I would like the job to fail so the process would need to exit with non-zero code Describe the solution you'd like

Add a cli flag (suggestion --bail), when the flag is set exit with non-zero code if scanning fails

Describe alternatives you've considered I could use the programmatic api, but I think this could be a useful feature

stale[bot] commented 9 months ago

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.