-
Notifications
You must be signed in to change notification settings - Fork 339
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
I have not found the mean to add the summary of a method with api.doc decorator.
It seems to be hardcoded in swagger.py at line 448:
"summary": doc[method]["docstring"]["summary"],
Describe the solution you'd like
As the description on the same method, replace the line by :
"summary": self.summary_for( doc, method) or None,
And create the following method:
def summary_for(self, doc, method):
"""Extract the summay metadata and fallback on the whole docstring"""
parts = []
if "summary" in doc:
parts.append(doc["summary"] or "")
if method in doc and "summary" in doc[method]:
parts.append(doc[method]["summary"])
if doc[method]["docstring"]["summary"]:
parts.append(doc[method]["docstring"]["summary"])
return "\n".join(parts).strip()
arazfeyzi, tisuela, engmsilva, carlosvega, FloLaco and 3 more
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request