Skip to content

Commit

Permalink
Add additional docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeSneyders committed Apr 10, 2022
1 parent bbeb817 commit f535806
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions connexion/apis/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def __init__(
*args,
**kwargs
):
"""Base API class with only minimal behavior related to the specification."""
logger.debug('Loading specification: %s', specification,
extra={'swagger_yaml': specification,
'base_path': base_path,
Expand Down
4 changes: 3 additions & 1 deletion connexion/middleware/swagger_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, app: ASGIApp) -> None:
:param app: app to wrap in middleware.
"""
self.app = app
# Pass unknown routes to next app
# Set default to pass unknown routes to next app
self.router = Router(default=self.default_fn)

def add_api(
Expand Down Expand Up @@ -62,6 +62,8 @@ async def default_fn(self, _scope: Scope, receive: Receive, send: Send) -> None:
Unfortunately we cannot just pass the next app as default, since the router manipulates
the scope when descending into mounts, losing information about the base path. Therefore,
we use the original scope instead.
This is caused by https://github.com/encode/starlette/issues/1336.
"""
original_scope = _original_scope.get()
await self.app(original_scope, receive, send)
Expand Down

0 comments on commit f535806

Please sign in to comment.