mirror of https://github.com/tiangolo/fastapi.git
📝 Restored Swagger-UI links to use the latest version possible. (#11459)
This commit is contained in:
parent
dda2337722
commit
a69f38340f
|
|
@ -96,8 +96,8 @@ Sie können wahrscheinlich mit der rechten Maustaste auf jeden Link klicken und
|
||||||
|
|
||||||
**Swagger UI** verwendet folgende Dateien:
|
**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/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.css" class="external-link" target="_blank">`swagger-ui.css`</a>
|
||||||
|
|
||||||
Und **ReDoc** verwendet diese Datei:
|
Und **ReDoc** verwendet diese Datei:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,8 @@ You can probably right-click each link and select an option similar to `Save lin
|
||||||
|
|
||||||
**Swagger UI** uses the files:
|
**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/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.css" class="external-link" target="_blank">`swagger-ui.css`</a>
|
||||||
|
|
||||||
And **ReDoc** uses the file:
|
And **ReDoc** uses the file:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ async def custom_swagger_ui_html():
|
||||||
openapi_url=app.openapi_url,
|
openapi_url=app.openapi_url,
|
||||||
title=app.title + " - Swagger UI",
|
title=app.title + " - Swagger UI",
|
||||||
oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url,
|
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_js_url="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js",
|
||||||
swagger_css_url="https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui.css",
|
swagger_css_url="https://unpkg.com/swagger-ui-dist@5/swagger-ui.css",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ def get_swagger_ui_html(
|
||||||
It is normally set to a CDN URL.
|
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[
|
swagger_css_url: Annotated[
|
||||||
str,
|
str,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -63,7 +63,7 @@ def get_swagger_ui_html(
|
||||||
It is normally set to a CDN URL.
|
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[
|
swagger_favicon_url: Annotated[
|
||||||
str,
|
str,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,8 @@ def client():
|
||||||
def test_swagger_ui_html(client: TestClient):
|
def test_swagger_ui_html(client: TestClient):
|
||||||
response = client.get("/docs")
|
response = client.get("/docs")
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
assert (
|
assert "https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js" in response.text
|
||||||
"https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui-bundle.js" in response.text
|
assert "https://unpkg.com/swagger-ui-dist@5/swagger-ui.css" in response.text
|
||||||
)
|
|
||||||
assert "https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui.css" in response.text
|
|
||||||
|
|
||||||
|
|
||||||
def test_swagger_ui_oauth2_redirect_html(client: TestClient):
|
def test_swagger_ui_oauth2_redirect_html(client: TestClient):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue