Skip to content

Commit 0a0b776

Browse files
committed
fix: renamed variable
1 parent 59902af commit 0a0b776

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

aws_lambda_powertools/event_handler/api_gateway.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ def enable_swagger(
16801680
compress: bool = False,
16811681
security_schemes: Optional[Dict[str, "SecurityScheme"]] = None,
16821682
security: Optional[List[Dict[str, List[str]]]] = None,
1683-
oauth2Config: Optional["OAuth2Config"] = None,
1683+
oauth2_config: Optional["OAuth2Config"] = None,
16841684
):
16851685
"""
16861686
Returns the OpenAPI schema as a JSON serializable dict
@@ -1719,7 +1719,7 @@ def enable_swagger(
17191719
A declaration of the security schemes available to be used in the specification.
17201720
security: List[Dict[str, List[str]]], optional
17211721
A declaration of which security mechanisms are applied globally across the API.
1722-
oauth2Config: OAuth2Config, optional
1722+
oauth2_config: OAuth2Config, optional
17231723
The OAuth2 configuration for the Swagger UI.
17241724
"""
17251725
from aws_lambda_powertools.event_handler.openapi.compat import model_json
@@ -1783,7 +1783,7 @@ def swagger_handler():
17831783
swagger_js,
17841784
swagger_css,
17851785
swagger_base_url,
1786-
oauth2Config,
1786+
oauth2_config,
17871787
)
17881788

17891789
return Response(

aws_lambda_powertools/event_handler/openapi/swagger_ui/html.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def generate_swagger_html(
99
swagger_js: str,
1010
swagger_css: str,
1111
swagger_base_url: str,
12-
oauth2: Optional[OAuth2Config],
12+
oauth2_config: Optional[OAuth2Config],
1313
) -> str:
1414
"""
1515
Generate Swagger UI HTML page
@@ -26,7 +26,7 @@ def generate_swagger_html(
2626
The URL to the Swagger UI CSS file
2727
swagger_base_url: str
2828
The base URL for Swagger UI
29-
oauth2: OAuth2Config, optional
29+
oauth2_config: OAuth2Config, optional
3030
The OAuth2 configuration.
3131
"""
3232

@@ -40,7 +40,9 @@ def generate_swagger_html(
4040
swagger_js_content = f"<script>{swagger_js}</script>"
4141

4242
# Prepare oauth2 config
43-
oauth2_content = f"ui.initOAuth({oauth2.json(exclude_none=True, exclude_unset=True)});" if oauth2 else ""
43+
oauth2_content = (
44+
f"ui.initOAuth({oauth2_config.json(exclude_none=True, exclude_unset=True)});" if oauth2_config else ""
45+
)
4446

4547
return f"""
4648
<!DOCTYPE html>

0 commit comments

Comments
 (0)