]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
⬆️ Update ReDoc to version 2.x (#9700)
authorJoakim Nordling <joakim.nordling@ioxio.com>
Mon, 28 Apr 2025 18:31:44 +0000 (21:31 +0300)
committerGitHub <noreply@github.com>
Mon, 28 Apr 2025 18:31:44 +0000 (20:31 +0200)
Co-authored-by: svlandeg <svlandeg@github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
docs/de/docs/how-to/custom-docs-ui-assets.md
docs/en/docs/how-to/custom-docs-ui-assets.md
docs/es/docs/how-to/custom-docs-ui-assets.md
docs/pt/docs/how-to/custom-docs-ui-assets.md
docs_src/custom_docs_ui/tutorial001.py
fastapi/openapi/docs.py
tests/test_application.py
tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py

index ab8cd9f6b8cdec0712fb6e73391188d45ad0ce2f..f68902b9901d13e0b9d23b1982051cbecc2f6698 100644 (file)
@@ -98,7 +98,7 @@ Sie können wahrscheinlich mit der rechten Maustaste auf jeden Link klicken und
 
 Und **ReDoc** verwendet diese Datei:
 
-* <a href="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js" class="external-link" target="_blank">`redoc.standalone.js`</a>
+* <a href="https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js" class="external-link" target="_blank">`redoc.standalone.js`</a>
 
 Danach könnte Ihre Dateistruktur wie folgt aussehen:
 
@@ -129,14 +129,8 @@ Sie sollten eine sehr lange JavaScript-Datei für **ReDoc** sehen.
 Sie könnte beginnen mit etwas wie:
 
 ```JavaScript
-/*!
- * ReDoc - OpenAPI/Swagger-generated API Reference Documentation
- * -------------------------------------------------------------
- *   Version: "2.0.0-rc.18"
- *   Repo: https://github.com/Redocly/redoc
- */
-!function(e,t){"object"==typeof exports&&"object"==typeof m
-
+/*! For license information please see redoc.standalone.js.LICENSE.txt */
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("null")):
 ...
 ```
 
index f717c98faafc08cd57cc3921923c6c34ca68b42d..9d2238e4f9189bb7424867027cf4fd695ae1aa03 100644 (file)
@@ -98,7 +98,7 @@ You can probably right-click each link and select an option similar to `Save lin
 
 And **ReDoc** uses the file:
 
-* <a href="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js" class="external-link" target="_blank">`redoc.standalone.js`</a>
+* <a href="https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js" class="external-link" target="_blank">`redoc.standalone.js`</a>
 
 After that, your file structure could look like:
 
@@ -129,14 +129,8 @@ You should see a very long JavaScript file for **ReDoc**.
 It could start with something like:
 
 ```JavaScript
-/*!
- * ReDoc - OpenAPI/Swagger-generated API Reference Documentation
- * -------------------------------------------------------------
- *   Version: "2.0.0-rc.18"
- *   Repo: https://github.com/Redocly/redoc
- */
-!function(e,t){"object"==typeof exports&&"object"==typeof m
-
+/*! For license information please see redoc.standalone.js.LICENSE.txt */
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("null")):
 ...
 ```
 
index 444cf167e9de418dfa482ef7b76d39d441c1bb02..0a03ff330b77db0bd6407b11e05ec05f33442377 100644 (file)
@@ -98,7 +98,7 @@ Probablemente puedas hacer clic derecho en cada enlace y seleccionar una opción
 
 Y **ReDoc** utiliza el archivo:
 
-* <a href="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js" class="external-link" target="_blank">`redoc.standalone.js`</a>
+* <a href="https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js" class="external-link" target="_blank">`redoc.standalone.js`</a>
 
 Después de eso, tu estructura de archivos podría verse así:
 
@@ -129,14 +129,8 @@ Deberías ver un archivo JavaScript muy largo de **ReDoc**.
 Podría comenzar con algo como:
 
 ```JavaScript
-/*!
- * ReDoc - OpenAPI/Swagger-generated API Reference Documentation
- * -------------------------------------------------------------
- *   Version: "2.0.0-rc.18"
- *   Repo: https://github.com/Redocly/redoc
- */
-!function(e,t){"object"==typeof exports&&"object"==typeof m
-
+/*! For license information please see redoc.standalone.js.LICENSE.txt */
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("null")):
 ...
 ```
 
index 3adc7529e161d78a7c41551533fe1c7d5f59934f..b7de6c8bdcd284f0e16ae85d78655dc7fa6fee92 100644 (file)
@@ -98,7 +98,7 @@ Você provavelmente pode clicar com o botão direito em cada link e selecionar u
 
 E o **ReDoc** usa os arquivos:
 
-* <a href="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js" class="external-link" target="_blank">`redoc.standalone.js`</a>
+* <a href="https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js" class="external-link" target="_blank">`redoc.standalone.js`</a>
 
 Depois disso, sua estrutura de arquivos deve se parecer com:
 
@@ -129,14 +129,8 @@ Você deverá ver um arquivo JavaScript muito longo para o **ReDoc**.
 Esse arquivo pode começar com algo como:
 
 ```JavaScript
-/*!
- * ReDoc - OpenAPI/Swagger-generated API Reference Documentation
- * -------------------------------------------------------------
- *   Version: "2.0.0-rc.18"
- *   Repo: https://github.com/Redocly/redoc
- */
-!function(e,t){"object"==typeof exports&&"object"==typeof m
-
+/*! For license information please see redoc.standalone.js.LICENSE.txt */
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("null")):
 ...
 ```
 
index f7ceb0c2fcf5c53ff6e51145d70c65dce4e04fbb..1cfcce19aa1bd13babd9f263031ef04b95eefc08 100644 (file)
@@ -29,7 +29,7 @@ async def redoc_html():
     return get_redoc_html(
         openapi_url=app.openapi_url,
         title=app.title + " - ReDoc",
-        redoc_js_url="https://unpkg.com/redoc@next/bundles/redoc.standalone.js",
+        redoc_js_url="https://unpkg.com/redoc@2/bundles/redoc.standalone.js",
     )
 
 
index c2ec358d2fed946d19b47dc02560e1a79819dd12..f181b43c1b9301308f48c0cd1f8df802dee3f0d2 100644 (file)
@@ -188,7 +188,7 @@ def get_redoc_html(
             It is normally set to a CDN URL.
             """
         ),
-    ] = "https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js",
+    ] = "https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js",
     redoc_favicon_url: Annotated[
         str,
         Doc(
index 5c62f5f6e2a013cb2033e6862108e50f70c72de8..a7d50ea72afe857ce1a62b6778d2882a1eacbe89 100644 (file)
@@ -43,7 +43,7 @@ def test_redoc():
     response = client.get("/redoc")
     assert response.status_code == 200, response.text
     assert response.headers["content-type"] == "text/html; charset=utf-8"
-    assert "redoc@next" in response.text
+    assert "redoc@2" in response.text
 
 
 def test_enum_status_code_response():
index aff070d74731015e8c3d36482f6151109550c39d..cb8e8c2248208eb5d08ad11b8727031d32baa487 100644 (file)
@@ -33,7 +33,7 @@ def test_swagger_ui_oauth2_redirect_html(client: TestClient):
 def test_redoc_html(client: TestClient):
     response = client.get("/redoc")
     assert response.status_code == 200, response.text
-    assert "https://unpkg.com/redoc@next/bundles/redoc.standalone.js" in response.text
+    assert "https://unpkg.com/redoc@2/bundles/redoc.standalone.js" in response.text
 
 
 def test_api(client: TestClient):