Skip to content

Commit

Permalink
Merge branch 'master' into feature/merge-auth-and-dev-mode-switch
Browse files Browse the repository at this point in the history
  • Loading branch information
byewokko committed Aug 28, 2023
2 parents b8d1f44 + a3ec0c2 commit 029c37d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions asab/api/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,17 @@ def __init__(self, api_service, app, web_container, config_section_name="asab:do

self.DefaultRouteTag: str = asab.Config["asab:doc"].get("default_route_tag")
if self.DefaultRouteTag not in ["module_name", "class_name"]:
raise ValueError("Unknown default_route_tag: {}. Choose between options 'module_name' and 'class_name'.".format(self.DefaultRouteTag))
raise ValueError(
"Unknown default_route_tag: {}. Choose between options "
"'module_name' and 'class_name'.".format(self.DefaultRouteTag))

self.ServerUrls: str = asab.Config.get(config_section_name, "server_urls", fallback="/").strip().split("\n")


def build_swagger_documentation(self) -> dict:
"""Take a docstring of the class and a docstring of methods and merge them into Swagger data."""
"""
Take a docstring of the class and a docstring of methods and merge them into Swagger data.
"""
app_doc_string: str = self.App.__doc__
app_description: str = get_description(app_doc_string)
specification: dict = {
Expand All @@ -60,7 +65,7 @@ def build_swagger_documentation(self) -> dict:
"version": "1.0.0",
},
"servers": [
{"url": "/", "description": "Here"}
{"url": url} for url in self.ServerUrls
],

# Base path relative to openapi endpoint
Expand Down

0 comments on commit 029c37d

Please sign in to comment.