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

Swagger from file #35

Merged
merged 4 commits into from Aug 2, 2016
Merged

Swagger from file #35

merged 4 commits into from Aug 2, 2016

Conversation

ninit
Copy link
Contributor

@ninit ninit commented Jul 30, 2016

Hi,

This is a proposal to decode a special line in a docstring swagger_from_file: path.

I think it could be useful sometimes to take the yaml swagger spec out of the docstring:

  • if you have other things to say in the docstring,
  • if it's easier to edit yaml code from a .yml file.

In the pull request you'll find besides flask_swagger.py a modified example and README.md

Please criticize as needed.
Thanks.

@@ -88,7 +120,8 @@ def _extract_array_defs(source):
return defs


def swagger(app, prefix=None, process_doc=_sanitize, template=None):
def swagger(app, prefix=None, process_doc=_sanitize,
from_file_keyword='swagger_from_file', template=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer from_file_keyword to be default None in which case skip the find_from_file process

@atlithorn
Copy link
Contributor

Otherwise looks good and thanks for contributing!

@ninit
Copy link
Contributor Author

ninit commented Aug 2, 2016

Thanks for your review.
You're right, it's better to leave this off by default.
I've just committed the change.

@atlithorn atlithorn merged commit 66a0397 into getsling:master Aug 2, 2016
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

2 participants