File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,8 +52,7 @@ def _get_ref(api_spec, path):
5252}
5353
5454
55- def _return_docstring (api_spec , operation ):
56- [status_code ] = operation ["responses" ].keys ()
55+ def _status_code_docstring (api_spec , operation , status_code ):
5756 [ctype ] = operation ["responses" ][status_code ]["content" ].keys ()
5857 return_schema = operation ["responses" ][status_code ]["content" ][ctype ][
5958 "schema"
@@ -96,6 +95,17 @@ def _return_docstring(api_spec, operation):
9695 return doc
9796
9897
98+ def _return_docstring (api_spec , operation ):
99+ status_codes_docs = [
100+ "{status_code}: {ret_type}" .format (
101+ status_code = status_code ,
102+ ret_type = _status_code_docstring (api_spec , operation , status_code ),
103+ )
104+ for status_code in operation ["responses" ].keys ()
105+ ]
106+
107+ return "\n " .join (status_codes_docs )
108+
99109class BaseClient :
100110 _api_spec = None
101111 _by_operation = None
You can’t perform that action at this time.
0 commit comments