Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 17 for get_swagger_ui_html (0.17 seconds)

  1. docs_src/custom_docs_ui/tutorial002_py310.py

    from fastapi.openapi.docs import (
        get_redoc_html,
        get_swagger_ui_html,
        get_swagger_ui_oauth2_redirect_html,
    )
    from fastapi.staticfiles import StaticFiles
    
    app = FastAPI(docs_url=None, redoc_url=None)
    
    app.mount("/static", StaticFiles(directory="static"), name="static")
    
    
    @app.get("/docs", include_in_schema=False)
    async def custom_swagger_ui_html():
        return get_swagger_ui_html(
            openapi_url=app.openapi_url,
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 1.1K bytes
    - Click Count (0)
  2. tests/test_swagger_ui_escape.py

    from fastapi.openapi.docs import get_swagger_ui_html
    
    
    def test_init_oauth_html_chars_are_escaped():
        xss_payload = "Evil</script><script>alert(1)</script>"
        html = get_swagger_ui_html(
            openapi_url="/openapi.json",
            title="Test",
            init_oauth={"appName": xss_payload},
        )
        body = html.body.decode()
    
        assert "</script><script>" not in body
        assert "\\u003c/script\\u003e\\u003cscript\\u003e" in body
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 24 09:28:10 GMT 2026
    - 1.1K bytes
    - Click Count (0)
  3. docs_src/custom_docs_ui/tutorial001_py310.py

    from fastapi import FastAPI
    from fastapi.openapi.docs import (
        get_redoc_html,
        get_swagger_ui_html,
        get_swagger_ui_oauth2_redirect_html,
    )
    
    app = FastAPI(docs_url=None, redoc_url=None)
    
    
    @app.get("/docs", include_in_schema=False)
    async def custom_swagger_ui_html():
        return get_swagger_ui_html(
            openapi_url=app.openapi_url,
            title=app.title + " - Swagger UI",
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 1.1K bytes
    - Click Count (0)
  4. docs/en/docs/how-to/configure-swagger-ui.md

    To configure them, pass the `swagger_ui_parameters` argument when creating the `FastAPI()` app object or to the `get_swagger_ui_html()` function.
    
    `swagger_ui_parameters` receives a dictionary with the configurations passed to Swagger UI directly.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 2.8K bytes
    - Click Count (0)
  5. docs/zh/docs/how-to/configure-swagger-ui.md

    # 配置 Swagger UI { #configure-swagger-ui }
    
    你可以配置一些额外的 [Swagger UI 参数](https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/)。
    
    如果需要配置它们,可以在创建 `FastAPI()` 应用对象时或调用 `get_swagger_ui_html()` 函数时传递 `swagger_ui_parameters` 参数。
    
    `swagger_ui_parameters` 接受一个字典,该字典会直接传递给 Swagger UI。
    
    FastAPI会将这些配置转换为 **JSON**,使其与 JavaScript 兼容,因为这是 Swagger UI 需要的。
    
    ## 禁用语法高亮 { #disable-syntax-highlighting }
    
    比如,你可以禁用 Swagger UI 中的语法高亮。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 2.7K bytes
    - Click Count (0)
  6. docs/ko/docs/how-to/configure-swagger-ui.md

    # Swagger UI 구성 { #configure-swagger-ui }
    
    추가적인 [Swagger UI 매개변수](https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/)를 구성할 수 있습니다.
    
    구성을 하려면, `FastAPI()` 앱 객체를 생성할 때 또는 `get_swagger_ui_html()` 함수에 `swagger_ui_parameters` 인수를 전달하십시오.
    
    `swagger_ui_parameters`는 Swagger UI에 직접 전달된 구성을 포함하는 딕셔너리를 받습니다.
    
    FastAPI는 이 구성을 **JSON** 형식으로 변환하여 JavaScript와 호환되도록 합니다. 이는 Swagger UI에서 필요로 하는 형식입니다.
    
    ## 구문 강조 비활성화 { #disable-syntax-highlighting }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 3.2K bytes
    - Click Count (0)
  7. docs/ja/docs/how-to/configure-swagger-ui.md

    # Swagger UI の設定 { #configure-swagger-ui }
    
    いくつかの追加の [Swagger UI パラメータ](https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/)を設定できます。
    
    設定するには、`FastAPI()` のアプリオブジェクトを作成するとき、または `get_swagger_ui_html()` 関数に `swagger_ui_parameters` 引数を渡します。
    
    `swagger_ui_parameters` は、Swagger UI に直接渡される設定を含む辞書を受け取ります。
    
    FastAPI はそれらの設定を **JSON** に変換し、JavaScript と互換にします。Swagger UI が必要とするのはこの形式です。
    
    ## シンタックスハイライトを無効化 { #disable-syntax-highlighting }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 3.3K bytes
    - Click Count (0)
  8. docs/zh-hant/docs/how-to/configure-swagger-ui.md

    # 設定 Swagger UI { #configure-swagger-ui }
    
    你可以設定一些額外的 [Swagger UI 參數](https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/)。
    
    要設定它們,建立 `FastAPI()` 應用物件時,或呼叫 `get_swagger_ui_html()` 函式時,傳入參數 `swagger_ui_parameters`。
    
    `swagger_ui_parameters` 接受一個 dict,內容會直接傳給 Swagger UI 作為設定。
    
    FastAPI 會把這些設定轉換成 **JSON**,以便與 JavaScript 相容,因為 Swagger UI 需要的是這種格式。
    
    ## 停用語法醒目提示 { #disable-syntax-highlighting }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 2.7K bytes
    - Click Count (0)
  9. tests/test_local_docs.py

    
    def test_strings_in_generated_swagger():
        sig = inspect.signature(get_swagger_ui_html)
        swagger_js_url = sig.parameters.get("swagger_js_url").default  # type: ignore
        swagger_css_url = sig.parameters.get("swagger_css_url").default  # type: ignore
        swagger_favicon_url = sig.parameters.get("swagger_favicon_url").default  # type: ignore
        html = get_swagger_ui_html(openapi_url="/docs", title="title")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Dec 20 18:50:00 GMT 2020
    - 2.4K bytes
    - Click Count (0)
  10. docs/en/docs/reference/openapi/docs.md

    # OpenAPI `docs`
    
    Utilities to handle OpenAPI automatic UI documentation, including Swagger UI (by default at `/docs`) and ReDoc (by default at `/redoc`).
    
    ::: fastapi.openapi.docs.get_swagger_ui_html
    
    ::: fastapi.openapi.docs.get_redoc_html
    
    ::: fastapi.openapi.docs.get_swagger_ui_oauth2_redirect_html
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Oct 18 12:36:40 GMT 2023
    - 360 bytes
    - Click Count (0)
Back to Top