Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions exoscale/api/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ def _get_ref(api_spec, path):
}


def _return_docstring(api_spec, operation):
[status_code] = operation["responses"].keys()
def _status_code_docstring(api_spec, operation, status_code):
[ctype] = operation["responses"][status_code]["content"].keys()
return_schema = operation["responses"][status_code]["content"][ctype][
"schema"
Expand Down Expand Up @@ -96,6 +95,17 @@ def _return_docstring(api_spec, operation):
return doc


def _return_docstring(api_spec, operation):
status_codes_docs = [
"{status_code}: {ret_type}".format(
status_code=status_code,
ret_type=_status_code_docstring(api_spec, operation, status_code),
)
for status_code in operation["responses"].keys()
]

return "\n ".join(status_codes_docs)

class BaseClient:
_api_spec = None
_by_operation = None
Expand Down
Loading