Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable swagger document caching when flask debug mode is on #250

Merged

Conversation

strongbugman
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.184% when pulling e5b19f0 on strongbugman:feature/debug_without_caching into 20a960b on rochacbruno:master.

Copy link
Collaborator

@javabrett javabrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this make an assumption that app is always set and is a Flask WSGI server?

I expect that in 90%+ of dev/debug situations, Flask will be being used and the dev/debug server enabled, which enables Flask's own reload/cache-busting, making this valid. But what if someone wanted to do this under another WSGI server e.g. Gunicorn with reload enabled?

Would it be better to provide Flasgger with a direct debug flag, which if not-specified and running under Flask would inherit from the Flask debug flag? That way it could be set if the Flask assumption was not true.

I haven't run Flasgger under Gunicorn, and my comments might be astray as a result.

@strongbugman
Copy link
Contributor Author

strongbugman commented Oct 8, 2018

Yes, Gunicorn with reloading won't enable flask's debug mode, but Gunicorn's reloading is not enough if someone wants to run flask app with whole debug mode. Gunicorn also provides an extra reloading If someone needs reloading only.

And it'll increase complexity if we provide an extra debug flag, imagine that the flask's debug is enabled while the flasgger's debug is closed.
So, in my opinion, it's enough if flasgger can be responsible for the flask, and other WSGI servers can active flask's debug mode too (FLASK_ENV or something else).

@javabrett javabrett merged commit a7f04b6 into flasgger:master Oct 9, 2018
@javabrett
Copy link
Collaborator

Thanks @strongbugman .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants