From 9c592cd1958e55e28164797fcac6260ebd099012 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 17:57:35 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Auto=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/openapi/docs.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/fastapi/openapi/docs.py b/fastapi/openapi/docs.py index 49a486f41..dda3d2190 100644 --- a/fastapi/openapi/docs.py +++ b/fastapi/openapi/docs.py @@ -131,24 +131,25 @@ def get_swagger_ui_html( const ui = SwaggerUIBundle({{ url: '{openapi_url}', """ - + for key, value in current_swagger_ui_parameters.items(): - encoded_value = jsonable_encoder(value) safe_value = json.dumps(encoded_value) - - - if isinstance(value, str) and safe_value.startswith('"') and safe_value.endswith('"'): + + if ( + isinstance(value, str) + and safe_value.startswith('"') + and safe_value.endswith('"') + ): safe_value = safe_value[1:-1] # Remove aspas externas - - + html += f" {key}: {safe_value},\n" - if oauth2_redirect_url: - html += f"oauth2RedirectUrl: window.location.origin + '{oauth2_redirect_url}',\n" + html += ( + f"oauth2RedirectUrl: window.location.origin + '{oauth2_redirect_url}',\n" + ) - html += """ presets: [ SwaggerUIBundle.presets.apis, SwaggerUIBundle.SwaggerUIStandalonePreset @@ -156,7 +157,6 @@ def get_swagger_ui_html( }) """ - if init_oauth: init_oauth_json = json.dumps(jsonable_encoder(init_oauth)) html += f"""