Skip to content

Commit f1d07ab

Browse files
authored
fix(event_handler): read swagger files with UTF-8 encoding (#8131)
fix: read swagger files with UTF-8 encoding
1 parent 12aeb50 commit f1d07ab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

aws_lambda_powertools/event_handler/api_gateway.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2224,8 +2224,12 @@ def swagger_handler():
22242224
# We now inject CSS and JS into the SwaggerUI file
22252225
swagger_js = Path.open(
22262226
Path(__file__).parent / "openapi" / "swagger_ui" / "swagger-ui-bundle.min.js",
2227+
encoding="utf-8",
2228+
).read()
2229+
swagger_css = Path.open(
2230+
Path(__file__).parent / "openapi" / "swagger_ui" / "swagger-ui.min.css",
2231+
encoding="utf-8",
22272232
).read()
2228-
swagger_css = Path.open(Path(__file__).parent / "openapi" / "swagger_ui" / "swagger-ui.min.css").read()
22292233

22302234
openapi_servers = servers or [Server(url=(base_path or "/"))]
22312235

0 commit comments

Comments
 (0)