Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 116 for userDir (0.04 sec)

  1. docs/ja/docs/tutorial/extra-models.md

    ### `**user_in.dict()`について
    
    #### Pydanticの`.dict()`
    
    `user_in`は`UserIn`クラスのPydanticモデルです。
    
    Pydanticモデルには、モデルのデータを含む`dict`を返す`.dict()`メソッドがあります。
    
    そこで、以下のようなPydanticオブジェクト`user_in`を作成すると:
    
    ```Python
    user_in = UserIn(username="john", password="secret", email="******@****.***")
    ```
    
    そして呼び出すと:
    
    ```Python
    user_dict = user_in.dict()
    ```
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  2. src/main/java/org/codelibs/core/lang/StringUtil.java

        }
    
        /**
         * Converts an underscore-separated string to camel case.
         * <p>
         * Usage example:
         * </p>
         *
         * <pre>
         * StringUtil.camelize("USER_ID")  = "UserId"
         * </pre>
         *
         * @param s
         *            the text
         * @return the resulting string
         */
        public static String camelize(String s) {
            if (s == null) {
    Registered: Sat Dec 20 08:55:33 UTC 2025
    - Last Modified: Sat Nov 22 11:21:59 UTC 2025
    - 21.5K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. tests/test_tutorial/test_path_params/test_tutorial003.py

    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        ("user_id", "expected_response"),
        [
            ("me", {"user_id": "the current user"}),
            ("alice", {"user_id": "alice"}),
        ],
    )
    def test_get_users(user_id: str, expected_response: dict):
        response = client.get(f"/users/{user_id}")
        assert response.status_code == 200, response.text
        assert response.json() == expected_response
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 4.6K bytes
    - Viewed (0)
  6. 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)
  7. 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):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Sep 29 03:29:38 UTC 2025
    - 1.5K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. tests/test_param_in_path_and_dependency.py

    from fastapi import Depends, FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    async def user_exists(user_id: int):
        return True
    
    
    @app.get("/users/{user_id}", dependencies=[Depends(user_exists)])
    async def read_users(user_id: int):
        pass
    
    
    client = TestClient(app)
    
    
    def test_read_users():
        response = client.get("/users/42")
        assert response.status_code == 200, response.text
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.1K bytes
    - Viewed (0)
Back to top