File tree 2 files changed +8
-6
lines changed
aws_lambda_powertools/event_handler
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1680,7 +1680,7 @@ def enable_swagger(
1680
1680
compress : bool = False ,
1681
1681
security_schemes : Optional [Dict [str , "SecurityScheme" ]] = None ,
1682
1682
security : Optional [List [Dict [str , List [str ]]]] = None ,
1683
- oauth2Config : Optional ["OAuth2Config" ] = None ,
1683
+ oauth2_config : Optional ["OAuth2Config" ] = None ,
1684
1684
):
1685
1685
"""
1686
1686
Returns the OpenAPI schema as a JSON serializable dict
@@ -1719,7 +1719,7 @@ def enable_swagger(
1719
1719
A declaration of the security schemes available to be used in the specification.
1720
1720
security: List[Dict[str, List[str]]], optional
1721
1721
A declaration of which security mechanisms are applied globally across the API.
1722
- oauth2Config : OAuth2Config, optional
1722
+ oauth2_config : OAuth2Config, optional
1723
1723
The OAuth2 configuration for the Swagger UI.
1724
1724
"""
1725
1725
from aws_lambda_powertools .event_handler .openapi .compat import model_json
@@ -1783,7 +1783,7 @@ def swagger_handler():
1783
1783
swagger_js ,
1784
1784
swagger_css ,
1785
1785
swagger_base_url ,
1786
- oauth2Config ,
1786
+ oauth2_config ,
1787
1787
)
1788
1788
1789
1789
return Response (
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ def generate_swagger_html(
9
9
swagger_js : str ,
10
10
swagger_css : str ,
11
11
swagger_base_url : str ,
12
- oauth2 : Optional [OAuth2Config ],
12
+ oauth2_config : Optional [OAuth2Config ],
13
13
) -> str :
14
14
"""
15
15
Generate Swagger UI HTML page
@@ -26,7 +26,7 @@ def generate_swagger_html(
26
26
The URL to the Swagger UI CSS file
27
27
swagger_base_url: str
28
28
The base URL for Swagger UI
29
- oauth2 : OAuth2Config, optional
29
+ oauth2_config : OAuth2Config, optional
30
30
The OAuth2 configuration.
31
31
"""
32
32
@@ -40,7 +40,9 @@ def generate_swagger_html(
40
40
swagger_js_content = f"<script>{ swagger_js } </script>"
41
41
42
42
# 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
+ )
44
46
45
47
return f"""
46
48
<!DOCTYPE html>
You can’t perform that action at this time.
0 commit comments