Skip to content

Commit

Permalink
Make middleware_app property private (#1737)
Browse files Browse the repository at this point in the history
So it doesn't show up in documentation.
  • Loading branch information
RobbeSneyders committed Oct 6, 2023
1 parent 649c7ec commit 382fbca
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ build:
- poetry config virtualenvs.create false
post_install:
# Install dependencies with 'docs' dependency group
- poetry install --with docs
- poetry install --with docs --all-extras
4 changes: 2 additions & 2 deletions connexion/apps/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AbstractApp:
interface, it delegates most of the work to the middleware and framework application.
"""

middleware_app: SpecMiddleware
_middleware_app: SpecMiddleware
"""
The application wrapped by the ConnexionMiddleware, which in its turn wraps the framework
application.
Expand Down Expand Up @@ -83,7 +83,7 @@ def __init__(
:obj:`security.SECURITY_HANDLERS`
"""
self.middleware = ConnexionMiddleware(
self.middleware_app,
self._middleware_app,
import_name=import_name,
lifespan=lifespan,
middlewares=middlewares,
Expand Down
4 changes: 2 additions & 2 deletions connexion/apps/asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def __init__(
:param security_map: A dictionary of security handlers to use. Defaults to
:obj:`security.SECURITY_HANDLERS`
"""
self.middleware_app: AsyncMiddlewareApp = AsyncMiddlewareApp()
self._middleware_app: AsyncMiddlewareApp = AsyncMiddlewareApp()

super().__init__(
import_name,
Expand All @@ -195,7 +195,7 @@ def __init__(
def add_url_rule(
self, rule, endpoint: str = None, view_func: t.Callable = None, **options
):
self.middleware_app.add_url_rule(
self._middleware_app.add_url_rule(
rule, endpoint=endpoint, view_func=view_func, **options
)

Expand Down
8 changes: 4 additions & 4 deletions connexion/apps/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
class FlaskApp(AbstractApp):
"""Connexion Application based on ConnexionMiddleware wrapping a Flask application."""

middleware_app: FlaskMiddlewareApp
_middleware_app: FlaskMiddlewareApp

def __init__(
self,
Expand Down Expand Up @@ -231,8 +231,8 @@ def __init__(
:param security_map: A dictionary of security handlers to use. Defaults to
:obj:`security.SECURITY_HANDLERS`
"""
self.middleware_app = FlaskMiddlewareApp(import_name, server_args or {})
self.app = self.middleware_app.app
self._middleware_app = FlaskMiddlewareApp(import_name, server_args or {})
self.app = self._middleware_app.app
super().__init__(
import_name,
lifespan=lifespan,
Expand All @@ -255,7 +255,7 @@ def __init__(
def add_url_rule(
self, rule, endpoint: str = None, view_func: t.Callable = None, **options
):
self.middleware_app.add_url_rule(
self._middleware_app.add_url_rule(
rule, endpoint=endpoint, view_func=view_func, **options
)

Expand Down

0 comments on commit 382fbca

Please sign in to comment.