Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for OPENAPI_URL (4.47 sec)

  1. docs_src/conditional_openapi/tutorial001.py

    from fastapi import FastAPI
    from pydantic_settings import BaseSettings
    
    
    class Settings(BaseSettings):
        openapi_url: str = "/openapi.json"
    
    
    settings = Settings()
    
    app = FastAPI(openapi_url=settings.openapi_url)
    
    
    @app.get("/")
    def root():
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 281 bytes
    - Viewed (0)
  2. docs_src/custom_docs_ui/tutorial001.py

    )
    
    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",
            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",
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Oct 30 09:58:58 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  3. docs_src/custom_docs_ui/tutorial002.py

    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,
            title=app.title + " - Swagger UI",
            oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url,
            swagger_js_url="/static/swagger-ui-bundle.js",
            swagger_css_url="/static/swagger-ui.css",
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  4. tests/test_local_docs.py

        html = get_redoc_html(openapi_url="/docs", title="title")
        body_content = html.body.decode()
        assert redoc_js_url in body_content
        assert redoc_favicon_url in body_content
    
    
    def test_strings_in_custom_redoc():
        redoc_js_url = "fake_redoc_file.js"
        redoc_favicon_url = "fake_redoc_file.png"
        html = get_redoc_html(
            openapi_url="/docs",
            title="title",
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Dec 20 18:50:00 GMT 2020
    - 2.4K bytes
    - Viewed (0)
  5. docs/de/docs/how-to/conditional-openapi.md

    ```
    
    Hier deklarieren wir die Einstellung `openapi_url` mit dem gleichen Defaultwert `"/openapi.json"`.
    
    Und dann verwenden wir das beim Erstellen der `FastAPI`-App.
    
    Dann könnten Sie OpenAPI (einschließlich der Dokumentationsoberflächen) deaktivieren, indem Sie die Umgebungsvariable `OPENAPI_URL` auf einen leeren String setzen, wie zum Beispiel:
    
    <div class="termy">
    
    ```console
    $ OPENAPI_URL= uvicorn main:app
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:18:13 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  6. 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
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  7. docs/em/docs/how-to/conditional-openapi.md

    🖼:
    
    ```Python hl_lines="6  11"
    {!../../../docs_src/conditional_openapi/tutorial001.py!}
    ```
    
    📥 👥 📣 ⚒ `openapi_url` ⏮️ 🎏 🔢 `"/openapi.json"`.
    
    &amp; ⤴️ 👥 ⚙️ ⚫️ 🕐❔ 🏗 `FastAPI` 📱.
    
    ⤴️ 👆 💪 ❎ 🗄 (✅ 🎚 🩺) ⚒ 🌐 🔢 `OPENAPI_URL` 🛁 🎻, 💖:
    
    <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)
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 2K bytes
    - Viewed (0)
  8. docs/en/docs/how-to/custom-docs-ui-assets.md

    You can re-use 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.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Oct 30 09:58:58 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  9. docs/ja/docs/how-to/conditional-openapi.md

    例えば、
    
    ```Python hl_lines="6  11"
    {!../../../docs_src/conditional_openapi/tutorial001.py!}
    ```
    
    ここでは `openapi_url` の設定を、デフォルトの `"/openapi.json"` のまま宣言しています。
    
    そして、これを `FastAPI` appを作る際に使います。
    
    それから、以下のように `OPENAPI_URL` という環境変数を空文字列に設定することによってOpenAPI (UIドキュメントを含む) を無効化することができます。
    
    <div class="termy">
    
    ```console
    $ OPENAPI_URL= uvicorn main:app
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  10. docs_src/metadata/tutorial002.py

    from fastapi import FastAPI
    
    app = FastAPI(openapi_url="/api/v1/openapi.json")
    
    
    @app.get("/items/")
    async def read_items():
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 02 04:55:20 GMT 2020
    - 154 bytes
    - Viewed (0)
Back to top