File tree 3 files changed +1
-32
lines changed
aws_lambda_powertools/event_handler
tests/functional/event_handler/_pydantic
3 files changed +1
-32
lines changed Original file line number Diff line number Diff line change @@ -1958,7 +1958,6 @@ def swagger_handler():
1958
1958
1959
1959
body = generate_swagger_html (
1960
1960
escaped_spec ,
1961
- f"{ base_path } { path } " ,
1962
1961
swagger_js ,
1963
1962
swagger_css ,
1964
1963
swagger_base_url ,
Original file line number Diff line number Diff line change 5
5
6
6
def generate_swagger_html (
7
7
spec : str ,
8
- path : str ,
9
8
swagger_js : str ,
10
9
swagger_css : str ,
11
10
swagger_base_url : str ,
@@ -19,8 +18,6 @@ def generate_swagger_html(
19
18
----------
20
19
spec: str
21
20
The OpenAPI spec
22
- path: str
23
- The path to the Swagger documentation
24
21
swagger_js: str
25
22
Swagger UI JavaScript source code or URL
26
23
swagger_css: str
@@ -94,7 +91,7 @@ def generate_swagger_html(
94
91
}}
95
92
96
93
var ui = SwaggerUIBundle(swaggerUIOptions)
97
- ui.specActions.updateUrl(' { path } ?format=json' );
94
+ ui.specActions.updateUrl(currentUrl.pathname + " ?format=json" );
98
95
{ oauth2_content }
99
96
</script>
100
97
</html>
Original file line number Diff line number Diff line change @@ -91,33 +91,6 @@ def test_openapi_swagger_json_view_with_custom_path():
91
91
assert "OpenAPI JSON View" in result ["body" ]
92
92
93
93
94
- def test_openapi_swagger_with_rest_api_default_stage ():
95
- app = APIGatewayRestResolver (enable_validation = True )
96
- app .enable_swagger ()
97
-
98
- event = load_event ("apiGatewayProxyEvent.json" )
99
- event ["path" ] = "/swagger"
100
- event ["requestContext" ]["stage" ] = "$default"
101
-
102
- result = app (event , {})
103
- assert result ["statusCode" ] == 200
104
- assert "ui.specActions.updateUrl('/swagger?format=json')" in result ["body" ]
105
-
106
-
107
- def test_openapi_swagger_with_rest_api_stage ():
108
- app = APIGatewayRestResolver (enable_validation = True )
109
- app .enable_swagger ()
110
-
111
- event = load_event ("apiGatewayProxyEvent.json" )
112
- event ["path" ] = "/swagger"
113
- event ["requestContext" ]["stage" ] = "prod"
114
- event ["requestContext" ]["path" ] = "/prod/swagger"
115
-
116
- result = app (event , {})
117
- assert result ["statusCode" ] == 200
118
- assert "ui.specActions.updateUrl('/prod/swagger?format=json')" in result ["body" ]
119
-
120
-
121
94
def test_openapi_swagger_with_persist_authorization ():
122
95
app = APIGatewayRestResolver (enable_validation = True )
123
96
app .enable_swagger (persist_authorization = True )
You can’t perform that action at this time.
0 commit comments