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

Parse views docstrings for summary/description #261

Closed
lafrech opened this issue Aug 2, 2018 · 2 comments
Closed

Parse views docstrings for summary/description #261

lafrech opened this issue Aug 2, 2018 · 2 comments

Comments

@lafrech
Copy link
Member

lafrech commented Aug 2, 2018

Following up on a discussion in flask-rest-api: marshmallow-code/flask-smorest#3.

A contributor suggested to parse the docstrings for summary. I think we can go further and also get description:

def my_view(...):
"""Summary

Long description...
"""

This could be done in apispec and it is compatible with the YAML docstring parsing:

def my_view(...):
"""Summary

Long description...
---
YAML stuff
"""

I didn't take much time to look into it any deeper.

Marking as 1.0 as I would like to at least take needed utils out of yaml_utils.py (trim_docstring, maybe dedent) back into utils (those have no yaml dependency).

Marking as backward incompatible in case the feature is activated by default.

@lafrech
Copy link
Member Author

lafrech commented Aug 2, 2018

On second thought, apispec does not need this as summary and description are passed in the YAML section. My bad.

Yet, I'd still like to do this before 1.0:

Marking as 1.0 as I would like to at least take needed utils out of yaml_utils.py (trim_docstring, maybe dedent) back into utils (those have no yaml dependency).

@lafrech
Copy link
Member Author

lafrech commented Aug 2, 2018

Closing in favor of #262. Sorry for the noise.

@lafrech lafrech closed this as completed Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant