Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for include_router (0.14 sec)

  1. tests/test_router_events.py

            state.sub_router_startup = True
    
        @sub_router.on_event("shutdown")
        def sub_router_shutdown() -> None:
            state.sub_router_shutdown = True
    
        router.include_router(sub_router)
        app.include_router(router)
    
        assert state.app_startup is False
        assert state.router_startup is False
        assert state.sub_router_startup is False
        assert state.app_shutdown is False
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 24 19:09:52 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  2. docs/en/docs/reference/fastapi.md

        options:
            members:
                - openapi_version
                - webhooks
                - state
                - dependency_overrides
                - openapi
                - websocket
                - include_router
                - get
                - put
                - post
                - delete
                - options
                - head
                - patch
                - trace
                - on_event
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 701 bytes
    - Viewed (0)
  3. tests/test_generate_unique_id_function.py

            responses={404: {"model": List[Message]}},
        )
        def post_subrouter(item1: Item, item2: Item):
            return item1, item2  # pragma: nocover
    
        router.include_router(sub_router)
        app.include_router(router, generate_unique_id_function=custom_generate_unique_id3)
        client = TestClient(app)
        response = client.get("/openapi.json")
        data = response.json()
        assert data == {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Jan 13 15:10:26 UTC 2024
    - 66.7K bytes
    - Viewed (0)
  4. docs/em/docs/tutorial/bigger-applications.md

    ## ๐Ÿ”Œ ๐ŸŽ ๐Ÿ“ป ๐Ÿ’— ๐Ÿ•ฐ โฎ๏ธ ๐ŸŽ `prefix`
    
    ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `.include_router()` ๐Ÿ’— ๐Ÿ•ฐ โฎ๏ธ *๐ŸŽ* ๐Ÿ“ป โš™๏ธ ๐ŸŽ ๐Ÿ”ก.
    
    ๐Ÿ‘‰ ๐Ÿ’ช โš , ๐Ÿ–ผ, ๐ŸŽฆ ๐ŸŽ ๐Ÿ› ๏ธ ๐Ÿ”ฝ ๐ŸŽ ๐Ÿ”ก, โœ… `/api/v1` & `/api/latest`.
    
    ๐Ÿ‘‰ ๐Ÿง โš™๏ธ ๐Ÿ‘ˆ ๐Ÿ‘† 5๏ธโƒฃ๐Ÿ“† ๐Ÿšซ ๐Ÿค™ ๐Ÿ’ช, โœ‹๏ธ โšซ๏ธ ๐Ÿ“ค ๐Ÿ’ผ ๐Ÿ‘†.
    
    ## ๐Ÿ”Œ `APIRouter` โž•1๏ธโƒฃ
    
    ๐ŸŽ ๐ŸŒŒ ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ”Œ `APIRouter` `FastAPI` ๐Ÿˆธ, ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ”Œ `APIRouter` โž•1๏ธโƒฃ `APIRouter` โš™๏ธ:
    
    ```Python
    router.include_router(other_router)
    ```
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 15.5K bytes
    - Viewed (0)
  5. docs/de/docs/tutorial/bigger-applications.md

    ```
    
    /// info
    
    `users.router` enthรคlt den `APIRouter` in der Datei `app/routers/users.py`.
    
    Und `items.router` enthรคlt den `APIRouter` in der Datei `app/routers/items.py`.
    
    ///
    
    Mit `app.include_router()` kรถnnen wir jeden `APIRouter` zur Hauptanwendung `FastAPI` hinzufรผgen.
    
    Es wird alle Routen von diesem Router als Teil von dieser inkludieren.
    
    /// note | "Technische Details"
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 21K bytes
    - Viewed (0)
  6. docs/en/docs/reference/apirouter.md

    You can import the `APIRouter` class directly from `fastapi`:
    
    ```python
    from fastapi import APIRouter
    ```
    
    ::: fastapi.APIRouter
        options:
            members:
                - websocket
                - include_router
                - get
                - put
                - post
                - delete
                - options
                - head
                - patch
                - trace
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 524 bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/bigger-applications.md

    /// info
    
    `users.router` contains the `APIRouter` inside of the file `app/routers/users.py`.
    
    And `items.router` contains the `APIRouter` inside of the file `app/routers/items.py`.
    
    ///
    
    With `app.include_router()` we can add each `APIRouter` to the main `FastAPI` application.
    
    It will include all the routes from that router as part of it.
    
    /// note | "Technical Details"
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 18.4K bytes
    - Viewed (0)
  8. docs/pt/docs/tutorial/bigger-applications.md

    /// info | "Informaรงรฃo"
    
    `users.router` contรฉm o `APIRouter` dentro do arquivo `app/routers/users.py`.
    
    E `items.router` contรฉm o `APIRouter` dentro do arquivo `app/routers/items.py`.
    
    ///
    
    Com `app.include_router()` podemos adicionar cada `APIRouter` ao aplicativo principal `FastAPI`.
    
    Ele incluirรก todas as rotas daquele roteador como parte dele.
    
    /// note | "Detalhe Tรฉcnico"
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 19.6K bytes
    - Viewed (0)
  9. docs/en/docs/advanced/testing-dependencies.md

    The original dependency could be used in a *path operation function*, a *path operation decorator* (when you don't use the return value), a `.include_router()` call, etc.
    
    FastAPI will still be able to override it.
    
    ///
    
    Then you can reset your overrides (remove them) by setting `app.dependency_overrides` to be an empty `dict`:
    
    ```Python
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  10. tests/test_annotated.py

        app = FastAPI()
    
        router = APIRouter(prefix="/nested")
    
        @router.get("/test")
        async def test(var: Annotated[str, Query()] = "bar"):
            return {"foo": var}
    
        app.include_router(router)
    
        client = TestClient(app)
    
        response = client.get("/nested/test")
        assert response.status_code == 200
        assert response.json() == {"foo": "bar"}
    
    
    def test_openapi_schema():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 10.2K bytes
    - Viewed (0)
Back to top