diff --git a/aws_lambda_powertools/event_handler/api_gateway.py b/aws_lambda_powertools/event_handler/api_gateway.py index 27357b5ddab..4a9fc142cf0 100644 --- a/aws_lambda_powertools/event_handler/api_gateway.py +++ b/aws_lambda_powertools/event_handler/api_gateway.py @@ -2224,8 +2224,12 @@ def swagger_handler(): # We now inject CSS and JS into the SwaggerUI file swagger_js = Path.open( Path(__file__).parent / "openapi" / "swagger_ui" / "swagger-ui-bundle.min.js", + encoding="utf-8", + ).read() + swagger_css = Path.open( + Path(__file__).parent / "openapi" / "swagger_ui" / "swagger-ui.min.css", + encoding="utf-8", ).read() - swagger_css = Path.open(Path(__file__).parent / "openapi" / "swagger_ui" / "swagger-ui.min.css").read() openapi_servers = servers or [Server(url=(base_path or "/"))]