getsling / flask-swagger

A swagger 2.0 spec extractor for flask
MIT License
457 stars 91 forks source link

Avoid running twice from CLI #52

Closed ocaballeror closed 4 years ago

ocaballeror commented 4 years ago

When running flaskswagger, the run() function would be invoked twice: One from the entrypoint and another by just importing build_swagger_spec.

This ensures the spec is only dumped once to stdout.

atlithorn commented 4 years ago

I would prefer if you just added the classical:

if __name__ == "__main__":
   run()
ocaballeror commented 4 years ago

Sure :+1: