]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
✨ Add `viewport` meta tag to improve Swagger UI on mobile devices (#14777)
authorJoab <joab0@proton.me>
Wed, 4 Feb 2026 13:35:58 +0000 (10:35 -0300)
committerGitHub <noreply@github.com>
Wed, 4 Feb 2026 13:35:58 +0000 (14:35 +0100)
fastapi/openapi/docs.py

index 632cc2c1d9d235834e7eebed641c1855c8007e28..bb387c609abf0d7123bc313b2ebcf9b1bad8d8cb 100644 (file)
@@ -139,6 +139,7 @@ def get_swagger_ui_html(
     <!DOCTYPE html>
     <html>
     <head>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <link type="text/css" rel="stylesheet" href="{swagger_css_url}">
     <link rel="shortcut icon" href="{swagger_favicon_url}">
     <title>{title}</title>