Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for read_users2 (0.12 sec)

  1. tests/test_tutorial/test_path_params/test_tutorial003b.py

    from docs_src.path_params.tutorial003b_py39 import app, read_users2
    
    client = TestClient(app)
    
    
    def test_get_users():
        response = client.get("/users")
        assert response.status_code == 200, response.text
        assert response.json() == ["Rick", "Morty"]
    
    
    def test_read_users2():  # Just for coverage
        assert asyncio.run(read_users2()) == ["Bean", "Elfo"]
    
    
    def test_openapi_schema():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  2. docs_src/path_params/tutorial003b_py39.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/users")
    async def read_users():
        return ["Rick", "Morty"]
    
    
    @app.get("/users")
    async def read_users2():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 193 bytes
    - Viewed (0)
  3. docs_src/bigger_applications/app_py39/routers/users.py

    router = APIRouter()
    
    
    @router.get("/users/", tags=["users"])
    async def read_users():
        return [{"username": "Rick"}, {"username": "Morty"}]
    
    
    @router.get("/users/me", tags=["users"])
    async def read_user_me():
        return {"username": "fakecurrentuser"}
    
    
    @router.get("/users/{username}", tags=["users"])
    async def read_user(username: str):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 407 bytes
    - Viewed (0)
  4. docs_src/path_operation_configuration/tutorial006_py39.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/", tags=["items"])
    async def read_items():
        return [{"name": "Foo", "price": 42}]
    
    
    @app.get("/users/", tags=["users"])
    async def read_users():
        return [{"username": "johndoe"}]
    
    
    @app.get("/elements/", tags=["items"], deprecated=True)
    async def read_elements():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 365 bytes
    - Viewed (0)
  5. docs_src/dependencies/tutorial012_py39.py

    app = FastAPI(dependencies=[Depends(verify_token), Depends(verify_key)])
    
    
    @app.get("/items/")
    async def read_items():
        return [{"item": "Portal Gun"}, {"item": "Plumbus"}]
    
    
    @app.get("/users/")
    async def read_users():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 696 bytes
    - Viewed (0)
  6. docs_src/configure_swagger_ui/tutorial002_py39.py

    from fastapi import FastAPI
    
    app = FastAPI(swagger_ui_parameters={"syntaxHighlight": {"theme": "obsidian"}})
    
    
    @app.get("/users/{username}")
    async def read_user(username: str):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 221 bytes
    - Viewed (0)
  7. docs_src/path_params/tutorial003_py39.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/users/me")
    async def read_user_me():
        return {"user_id": "the current user"}
    
    
    @app.get("/users/{user_id}")
    async def read_user(user_id: str):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 236 bytes
    - Viewed (0)
  8. docs_src/path_operation_configuration/tutorial002b_py39.py

        items = "items"
        users = "users"
    
    
    @app.get("/items/", tags=[Tags.items])
    async def get_items():
        return ["Portal gun", "Plumbus"]
    
    
    @app.get("/users/", tags=[Tags.users])
    async def read_users():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 323 bytes
    - Viewed (0)
  9. docs_src/dependencies/tutorial001_py39.py

    ):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/items/")
    async def read_items(commons: dict = Depends(common_parameters)):
        return commons
    
    
    @app.get("/users/")
    async def read_users(commons: dict = Depends(common_parameters)):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 442 bytes
    - Viewed (0)
  10. docs_src/openapi_webhooks/tutorial001_py39.py

        When a new user subscribes to your service we'll send you a POST request with this
        data to the URL that you register for the event `new-subscription` in the dashboard.
        """
    
    
    @app.get("/users/")
    def read_users():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 550 bytes
    - Viewed (0)
Back to top