Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 132 for userDir (0.07 sec)

  1. 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)
  2. tests/test_validation_error_context.py

    async def websocket_validation_handler(
        websocket: WebSocket, exc: WebSocketRequestValidationError
    ):
        captured_exception.capture(exc)
        raise exc
    
    
    @app.get("/users/{user_id}")
    def get_user(user_id: int):
        return {"user_id": user_id}  # pragma: no cover
    
    
    @app.get("/items/", response_model=Item)
    def get_item():
        return {"name": "Widget"}
    
    
    @sub_app.get("/items/", response_model=Item)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 06 12:21:57 UTC 2025
    - 4.7K bytes
    - Viewed (0)
  3. tests/test_dependency_yield_except_httpexception.py

    
    @app.put("/invalid-user/{user_id}")
    def put_invalid_user(
        user_id: str, name: str = Body(), db: dict = Depends(get_database)
    ):
        db[user_id] = name
        raise HTTPException(status_code=400, detail="Invalid user")
    
    
    @app.put("/user/{user_id}")
    def put_user(user_id: str, name: str = Body(), db: dict = Depends(get_database)):
        db[user_id] = name
        return {"message": "OK"}
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Sep 29 03:29:38 UTC 2025
    - 1.9K bytes
    - Viewed (0)
  4. tests/test_infer_param_optionality.py

    
    @user_router.get("/")
    def get_users():
        return [{"user_id": "u1"}, {"user_id": "u2"}]
    
    
    @user_router.get("/{user_id}")
    def get_user(user_id: str):
        return {"user_id": user_id}
    
    
    @item_router.get("/")
    def get_items(user_id: Optional[str] = None):
        if user_id is None:
            return [{"item_id": "i1", "user_id": "u1"}, {"item_id": "i2", "user_id": "u2"}]
        else:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 12.1K bytes
    - Viewed (0)
  5. docs_src/query_params/tutorial004_py310.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/users/{user_id}/items/{item_id}")
    async def read_user_item(
        user_id: int, item_id: str, q: str | None = None, short: bool = False
    ):
        item = {"item_id": item_id, "owner_id": user_id}
        if q:
            item.update({"q": q})
        if not short:
            item.update(
                {"description": "This is an amazing item that has a long description"}
            )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 436 bytes
    - Viewed (0)
  6. docs_src/query_params/tutorial004_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/users/{user_id}/items/{item_id}")
    async def read_user_item(
        user_id: int, item_id: str, q: Union[str, None] = None, short: bool = False
    ):
        item = {"item_id": item_id, "owner_id": user_id}
        if q:
            item.update({"q": q})
        if not short:
            item.update(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 468 bytes
    - Viewed (0)
  7. docs_src/response_model/tutorial002_py39.py

    from fastapi import FastAPI
    from pydantic import BaseModel, EmailStr
    
    app = FastAPI()
    
    
    class UserIn(BaseModel):
        username: str
        password: str
        email: EmailStr
        full_name: Union[str, None] = None
    
    
    # Don't do this in production!
    @app.post("/user/")
    async def create_user(user: UserIn) -> UserIn:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 350 bytes
    - Viewed (0)
  8. 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:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Jan 07 13:45:48 UTC 2023
    - 318 bytes
    - Viewed (0)
  9. clause/joins_test.go

    				},
    			},
    			sql: "LEFT JOIN `user` ON `user_info`.`user_id` = `users`.`id`",
    		},
    		{
    			name: "RIGHT JOIN",
    			join: clause.Join{
    				Type:  clause.RightJoin,
    				Table: clause.Table{Name: "user"},
    				ON: clause.Where{
    					Exprs: []clause.Expression{clause.Eq{clause.Column{Table: "user_info", Name: "user_id"}, clause.PrimaryColumn}},
    				},
    			},
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Thu Nov 03 13:03:13 UTC 2022
    - 2.6K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_response_model/test_tutorial002.py

                                    "schema": {"$ref": "#/components/schemas/UserIn"}
                                }
                            },
                            "required": True,
                        },
                    }
                }
            },
            "components": {
                "schemas": {
                    "UserIn": {
                        "title": "UserIn",
                        "required": ["username", "password", "email"],
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 4.4K bytes
    - Viewed (0)
Back to top