Surnet / swagger-jsdoc

Generates swagger/openapi specification based on jsDoc comments and YAML files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

vidhill opened this issue · comments

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

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.