maxdome / swagger-combine

Combines multiple Swagger schemas into one dereferenced schema.
MIT License
132 stars 36 forks source link

Exit Code On Failure #67

Closed cbautista1002 closed 5 years ago

cbautista1002 commented 5 years ago

Currently if swagger-combine fails to process a file, eg: source swagger files have a syntax error or apis listing is invalid, swagger-combine exits with a 0 exit code. Ideally a non-zero exit code should be returned. This would help with automation scripts where we don't want the script to continue processing if swagger-combine wasn't able to process the files.

For now, I'm going to have to check the output of the call to swagger-combine to see if it returned some error text which is not ideal.

Thoughts? Thanks!

tmack8001 commented 5 years ago

Definitely think this would be helpful.

In my scripts I've added the following in order to exit with a failure code (very rough and dirty):

[[ $( ${SWAGGER_COMBINE_CMD} ./swagger-sources.json -o ../swagger-combined.json) != "" ]] && exit 1
cbautista1002 commented 5 years ago

Thanks for taking care of this @tmack8001. Greatly appreciated