Skip to content

Commit

Permalink
Improve type hints for nullable dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
druizz90 committed Sep 4, 2024
1 parent 0037147 commit 4e11096
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion connexion/frameworks/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def build_response(
data: t.Any,
*,
content_type: t.Optional[str] = None,
headers: dict = None,
headers: t.Optional[dict] = None,
status_code: int = None
):
raise NotImplementedError
Expand Down
2 changes: 1 addition & 1 deletion connexion/frameworks/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def build_response(
data: t.Any,
*,
content_type: t.Optional[str] = None,
headers: dict = None,
headers: t.Optional[dict] = None,
status_code: int = None
):
if cls.is_framework_response(data):
Expand Down
2 changes: 1 addition & 1 deletion connexion/frameworks/starlette.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def build_response(
data: t.Any,
*,
content_type: t.Optional[str] = None,
headers: dict = None,
headers: t.Optional[dict] = None,
status_code: int = None,
):
if isinstance(data, dict) or isinstance(data, list):
Expand Down
6 changes: 5 additions & 1 deletion connexion/middleware/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:

class SecurityAPI(RoutedAPI[SecurityOperation]):
def __init__(
self, *args, auth_all_paths: bool = False, security_map: dict = None, **kwargs
self,
*args,
auth_all_paths: bool = False,
security_map: t.Optional[dict] = None,
**kwargs,
):
super().__init__(*args, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion connexion/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TestContext:
def __init__(
self,
*,
context: dict = None,
context: t.Optional[dict] = None,
operation: AbstractOperation = None,
receive: Receive = None,
scope: Scope = None,
Expand Down

0 comments on commit 4e11096

Please sign in to comment.