Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 50 for OPENAPI_URL (0.16 seconds)

  1. docs/zh-hant/docs/how-to/conditional-openapi.md

    你可以用相同的 Pydantic 設定,來配置產生的 OpenAPI 與文件 UI。
    
    例如:
    
    {* ../../docs_src/conditional_openapi/tutorial001_py310.py hl[6,11] *}
    
    這裡我們宣告 `openapi_url` 設定,預設值同樣是 `"/openapi.json"`。
    
    接著在建立 `FastAPI` 應用時使用它。
    
    然後你可以將環境變數 `OPENAPI_URL` 設為空字串,以停用 OpenAPI(包含文件 UI),如下:
    
    <div class="termy">
    
    ```console
    $ OPENAPI_URL= uvicorn main:app
    
    <span style="color: green;">INFO</span>:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
    ```
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 2.1K bytes
    - Click Count (0)
  2. docs/en/docs/how-to/conditional-openapi.md

    Here we declare the setting `openapi_url` with the same default of `"/openapi.json"`.
    
    And then we use it when creating the `FastAPI` app.
    
    Then you could disable OpenAPI (including the UI docs) by setting the environment variable `OPENAPI_URL` to the empty string, like:
    
    <div class="termy">
    
    ```console
    $ OPENAPI_URL= uvicorn main:app
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 2.4K bytes
    - Click Count (0)
  3. docs/zh/docs/how-to/conditional-openapi.md

    例如:
    
    {* ../../docs_src/conditional_openapi/tutorial001_py310.py hl[6,11] *}
    
    这里我们声明了设置项 `openapi_url`,其默认值同样是 `"/openapi.json"`。
    
    然后在创建 `FastAPI` 应用时使用它。
    
    接着,你可以通过把环境变量 `OPENAPI_URL` 设为空字符串来禁用 OpenAPI(包括文档 UI),例如:
    
    <div class="termy">
    
    ```console
    $ OPENAPI_URL= uvicorn main:app
    
    <span style="color: green;">INFO</span>:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
    ```
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 2.2K bytes
    - Click Count (0)
  4. docs/ja/docs/how-to/conditional-openapi.md

    例えば、
    
    {* ../../docs_src/conditional_openapi/tutorial001_py310.py hl[6,11] *}
    
    ここでは `openapi_url` の設定を、デフォルトの `"/openapi.json"` のまま宣言しています。
    
    そして、これを `FastAPI` appを作る際に使います。
    
    それから、以下のように `OPENAPI_URL` という環境変数を空文字列に設定することによってOpenAPI (UIドキュメントを含む) を無効化することができます。
    
    <div class="termy">
    
    ```console
    $ OPENAPI_URL= uvicorn main:app
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 3.2K bytes
    - Click Count (0)
  5. docs/en/docs/how-to/custom-docs-ui-assets.md

    You can reuse FastAPI's internal functions to create the HTML pages for the docs, and pass them the needed arguments:
    
    * `openapi_url`: the URL where the HTML page for the docs can get the OpenAPI schema for your API. You can use here the attribute `app.openapi_url`.
    * `title`: the title of your API.
    * `oauth2_redirect_url`: you can use `app.swagger_ui_oauth2_redirect_url` here to use the default.
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 7.5K bytes
    - Click Count (0)
  6. docs/en/docs/tutorial/metadata.md

    By default, the OpenAPI schema is served at `/openapi.json`.
    
    But you can configure it with the parameter `openapi_url`.
    
    For example, to set it to be served at `/api/v1/openapi.json`:
    
    {* ../../docs_src/metadata/tutorial002_py310.py hl[3] *}
    
    If you want to disable the OpenAPI schema completely you can set `openapi_url=None`, that will also disable the documentation user interfaces that use it.
    
    ## Docs URLs { #docs-urls }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 5.8K bytes
    - Click Count (0)
  7. docs/zh-hant/docs/how-to/custom-docs-ui-assets.md

    ### 加入自訂文件 { #include-the-custom-docs }
    
    現在你可以為自訂文件建立「路徑操作(path operation)」。
    
    你可以重用 FastAPI 的內部函式來建立文件的 HTML 頁面,並傳入所需參數:
    
    * `openapi_url`:文件 HTML 頁面用來取得你 API 的 OpenAPI schema 的 URL。可使用屬性 `app.openapi_url`。
    * `title`:你的 API 標題。
    * `oauth2_redirect_url`:可使用 `app.swagger_ui_oauth2_redirect_url` 以沿用預設值。
    * `swagger_js_url`:Swagger UI 文件 HTML 用來取得「JavaScript」檔案的 URL。這是你的自訂 CDN 位址。
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 6.9K bytes
    - Click Count (0)
  8. docs/zh/docs/tutorial/metadata.md

    ## OpenAPI URL { #openapi-url }
    
    默认情况下,OpenAPI 模式服务于 `/openapi.json`。
    
    但是你可以通过参数 `openapi_url` 对其进行配置。
    
    例如,将其设置为服务于 `/api/v1/openapi.json`:
    
    {* ../../docs_src/metadata/tutorial002_py310.py hl[3] *}
    
    如果你想完全禁用 OpenAPI 模式,可以将其设置为 `openapi_url=None`,这样也会禁用使用它的文档用户界面。
    
    ## 文档 URLs { #docs-urls }
    
    你可以配置两个文档用户界面,包括:
    
    - **Swagger UI**:服务于 `/docs`。
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 5.6K bytes
    - Click Count (0)
  9. docs/ko/docs/tutorial/metadata.md

    ## OpenAPI URL { #openapi-url }
    
    기본적으로 OpenAPI 스키마는 `/openapi.json`에서 제공됩니다.
    
    하지만 `openapi_url` 매개변수로 이를 설정할 수 있습니다.
    
    예를 들어, 이를 `/api/v1/openapi.json`에서 제공하도록 설정하려면:
    
    {* ../../docs_src/metadata/tutorial002_py310.py hl[3] *}
    
    OpenAPI 스키마를 완전히 비활성화하려면 `openapi_url=None`으로 설정할 수 있으며, 이를 사용하여 문서화 사용자 인터페이스도 비활성화됩니다.
    
    ## 문서화 URL { #docs-urls }
    
    포함된 두 가지 문서화 사용자 인터페이스를 설정할 수 있습니다:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 6.6K bytes
    - Click Count (0)
  10. docs/zh-hant/docs/tutorial/metadata.md

    ## OpenAPI URL { #openapi-url }
    
    預設情況下,OpenAPI 綱要(schema)會提供在 `/openapi.json`。
    
    但你可以用 `openapi_url` 參數來調整。
    
    例如,將它設定為提供在 `/api/v1/openapi.json`:
    
    {* ../../docs_src/metadata/tutorial002_py310.py hl[3] *}
    
    如果你想完全停用 OpenAPI 綱要,可以設定 `openapi_url=None`,同時也會停用依賴它的文件使用者介面。
    
    ## 文件 URL { #docs-urls }
    
    你可以設定內建的兩個文件使用者介面:
    
    * Swagger UI:提供於 `/docs`。
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 5.6K bytes
    - Click Count (0)
Back to Top