Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for userId (0.17 sec)

  1. tests/test_response_model_data_filter_no_inheritance.py

        password: str
    
    
    class UserDB(BaseModel):
        email: str
        hashed_password: str
    
    
    class User(BaseModel):
        email: str
    
    
    class PetDB(BaseModel):
        name: str
        owner: UserDB
    
    
    class PetOut(BaseModel):
        name: str
        owner: User
    
    
    @app.post("/users/", response_model=User)
    async def create_user(user: UserCreate):
        return user
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  2. docs_src/bigger_applications/app_an_py39/routers/users.py

    from fastapi import APIRouter
    
    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):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 407 bytes
    - Viewed (0)
  3. docs_src/response_model/tutorial003.py

    app = FastAPI()
    
    
    class UserIn(BaseModel):
        username: str
        password: str
        email: EmailStr
        full_name: Union[str, None] = None
    
    
    class UserOut(BaseModel):
        username: str
        email: EmailStr
        full_name: Union[str, None] = None
    
    
    @app.post("/user/", response_model=UserOut)
    async def create_user(user: UserIn) -> Any:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 450 bytes
    - Viewed (0)
  4. docs_src/bigger_applications/app/routers/users.py

    from fastapi import APIRouter
    
    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):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Nov 29 17:32:18 GMT 2020
    - 407 bytes
    - Viewed (0)
  5. docs_src/bigger_applications/app_an/routers/users.py

    from fastapi import APIRouter
    
    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):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 407 bytes
    - Viewed (0)
  6. docs_src/response_model/tutorial002_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel, EmailStr
    
    app = FastAPI()
    
    
    class UserIn(BaseModel):
        username: str
        password: str
        email: EmailStr
        full_name: str | None = None
    
    
    # Don't do this in production!
    @app.post("/user/")
    async def create_user(user: UserIn) -> UserIn:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 318 bytes
    - Viewed (0)
  7. docs_src/path_params/tutorial003b.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/users")
    async def read_users():
        return ["Rick", "Morty"]
    
    
    @app.get("/users")
    async def read_users2():
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 12 16:16:16 GMT 2022
    - 193 bytes
    - Viewed (0)
  8. tests/test_route_scope.py

    from fastapi.routing import APIRoute, APIWebSocketRoute
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.get("/users/{user_id}")
    async def get_user(user_id: str, request: Request):
        route: APIRoute = request.scope["route"]
        return {"user_id": user_id, "path": route.path}
    
    
    @app.websocket("/items/{item_id}")
    async def websocket_item(item_id: str, websocket: WebSocket):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Feb 08 10:23:07 GMT 2023
    - 1.5K bytes
    - Viewed (0)
Back to top