]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Restored Swagger-UI links to use the latest version possible. (#11459)
authorNir Schulman <narsssx@gmail.com>
Thu, 23 May 2024 22:59:02 +0000 (01:59 +0300)
committerGitHub <noreply@github.com>
Thu, 23 May 2024 22:59:02 +0000 (17:59 -0500)
docs/de/docs/how-to/custom-docs-ui-assets.md
docs/en/docs/how-to/custom-docs-ui-assets.md
docs_src/custom_docs_ui/tutorial001.py
fastapi/openapi/docs.py
tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py

index 991eaf26922f1d9ab633e2b5b5a7e1c3c8a54368..a9271b3f3f1e11ade1a5dc6adf6010bd61624104 100644 (file)
@@ -96,8 +96,8 @@ Sie können wahrscheinlich mit der rechten Maustaste auf jeden Link klicken und
 
 **Swagger UI** verwendet folgende Dateien:
 
-* <a href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.9.0/swagger-ui-bundle.js" class="external-link" target="_blank">`swagger-ui-bundle.js`</a>
-* <a href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.9.0/swagger-ui.css" class="external-link" target="_blank">`swagger-ui.css`</a>
+* <a href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js" class="external-link" target="_blank">`swagger-ui-bundle.js`</a>
+* <a href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css" class="external-link" target="_blank">`swagger-ui.css`</a>
 
 Und **ReDoc** verwendet diese Datei:
 
index adc1c1ef45160c119786ae62c5b9b5801bb9d5a1..053e5eacd4d6364baeff1e00e5c8cbb5ec782ae8 100644 (file)
@@ -96,8 +96,8 @@ You can probably right-click each link and select an option similar to `Save lin
 
 **Swagger UI** uses the files:
 
-* <a href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.9.0/swagger-ui-bundle.js" class="external-link" target="_blank">`swagger-ui-bundle.js`</a>
-* <a href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.9.0/swagger-ui.css" class="external-link" target="_blank">`swagger-ui.css`</a>
+* <a href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js" class="external-link" target="_blank">`swagger-ui-bundle.js`</a>
+* <a href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css" class="external-link" target="_blank">`swagger-ui.css`</a>
 
 And **ReDoc** uses the file:
 
index 4384433e37c50618a9b4e6f2ee920770b1275f40..f7ceb0c2fcf5c53ff6e51145d70c65dce4e04fbb 100644 (file)
@@ -14,8 +14,8 @@ async def custom_swagger_ui_html():
         openapi_url=app.openapi_url,
         title=app.title + " - Swagger UI",
         oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url,
-        swagger_js_url="https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui-bundle.js",
-        swagger_css_url="https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui.css",
+        swagger_js_url="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js",
+        swagger_css_url="https://unpkg.com/swagger-ui-dist@5/swagger-ui.css",
     )
 
 
index 67815e0fb5d3d5fc5521c0797cb7262e1d155aec..c2ec358d2fed946d19b47dc02560e1a79819dd12 100644 (file)
@@ -53,7 +53,7 @@ def get_swagger_ui_html(
             It is normally set to a CDN URL.
             """
         ),
-    ] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.9.0/swagger-ui-bundle.js",
+    ] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js",
     swagger_css_url: Annotated[
         str,
         Doc(
@@ -63,7 +63,7 @@ def get_swagger_ui_html(
             It is normally set to a CDN URL.
             """
         ),
-    ] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.9.0/swagger-ui.css",
+    ] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css",
     swagger_favicon_url: Annotated[
         str,
         Doc(
index 34a18b12ca4a72fd24392b7c126d69074cef9aed..aff070d74731015e8c3d36482f6151109550c39d 100644 (file)
@@ -20,10 +20,8 @@ def client():
 def test_swagger_ui_html(client: TestClient):
     response = client.get("/docs")
     assert response.status_code == 200, response.text
-    assert (
-        "https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui-bundle.js" in response.text
-    )
-    assert "https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui.css" in response.text
+    assert "https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js" in response.text
+    assert "https://unpkg.com/swagger-ui-dist@5/swagger-ui.css" in response.text
 
 
 def test_swagger_ui_oauth2_redirect_html(client: TestClient):