Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 21 - 30 of 402 for item_2 (0.04 seconds)

  1. docs/en/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md

    {* ../../docs_src/pydantic_v1_in_v2/tutorial003_an_py310.py hl[2:3,6,12,21:22] *}
    
    In this example above, the input model is a Pydantic v1 model, and the output model (defined in `response_model=ItemV2`) is a Pydantic v2 model.
    
    ### Pydantic v1 parameters { #pydantic-v1-parameters }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 5.4K bytes
    - Click Count (0)
  2. docs_src/response_model/tutorial005_py310.py

        },
    }
    
    
    @app.get(
        "/items/{item_id}/name",
        response_model=Item,
        response_model_include={"name", "description"},
    )
    async def read_item_name(item_id: str):
        return items[item_id]
    
    
    @app.get("/items/{item_id}/public", response_model=Item, response_model_exclude={"tax"})
    async def read_item_public_data(item_id: str):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 816 bytes
    - Click Count (0)
  3. tests/test_tutorial/test_body_multiple_params/test_tutorial001.py

    def test_post_no_body_q_bar(client: TestClient):
        response = client.put("/items/5?q=bar", json=None)
        assert response.status_code == 200
        assert response.json() == {"item_id": 5, "q": "bar"}
    
    
    def test_post_no_body(client: TestClient):
        response = client.put("/items/5", json=None)
        assert response.status_code == 200
        assert response.json() == {"item_id": 5}
    
    
    def test_post_id_foo(client: TestClient):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 6.9K bytes
    - Click Count (0)
  4. docs_src/events/tutorial001_py310.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    items = {}
    
    
    @app.on_event("startup")
    async def startup_event():
        items["foo"] = {"name": "Fighters"}
        items["bar"] = {"name": "Tenders"}
    
    
    @app.get("/items/{item_id}")
    async def read_items(item_id: str):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 283 bytes
    - Click Count (0)
  5. tests/test_tutorial/test_body/test_tutorial003.py

                "paths": {
                    "/items/{item_id}": {
                        "put": {
                            "parameters": [
                                {
                                    "in": "path",
                                    "name": "item_id",
                                    "required": True,
                                    "schema": {
                                        "title": "Item Id",
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 6.1K bytes
    - Click Count (0)
  6. tests/test_tutorial/test_body_nested_models/test_tutorial006.py

                "paths": {
                    "/items/{item_id}": {
                        "put": {
                            "parameters": [
                                {
                                    "in": "path",
                                    "name": "item_id",
                                    "required": True,
                                    "schema": {
                                        "title": "Item Id",
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 9.5K bytes
    - Click Count (0)
  7. tests/test_tutorial/test_body_nested_models/test_tutorial004.py

                "paths": {
                    "/items/{item_id}": {
                        "put": {
                            "parameters": [
                                {
                                    "in": "path",
                                    "name": "item_id",
                                    "required": True,
                                    "schema": {
                                        "title": "Item Id",
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 9.5K bytes
    - Click Count (0)
  8. docs/uk/docs/index.md

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
        is_offer: bool | None = None
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: str | None = None):
        return {"item_id": item_id, "q": q}
    
    
    @app.put("/items/{item_id}")
    def update_item(item_id: int, item: Item):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:27:41 GMT 2026
    - 29.1K bytes
    - Click Count (0)
  9. src/test/java/org/codelibs/fess/script/ScriptEngineTest.java

        public void test_evaluate_withArrayParameter() {
            String template = "Items: ${items}";
            Map<String, Object> paramMap = new HashMap<>();
            String[] items = { "item1", "item2", "item3" };
            paramMap.put("items", items);
    
            Object result = scriptEngine.evaluate(template, paramMap);
            assertTrue(result.toString().contains("item1"));
        }
    
        // Test evaluate method returns different object type
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Wed Jan 14 14:29:07 GMT 2026
    - 12.5K bytes
    - Click Count (0)
  10. docs/zh/docs/index.md

    用浏览器打开 [http://127.0.0.1:8000/items/5?q=somequery](http://127.0.0.1:8000/items/5?q=somequery)。
    
    你会看到如下 JSON 响应:
    
    ```JSON
    {"item_id": 5, "q": "somequery"}
    ```
    
    你已经创建了一个 API,它可以:
    
    * 在路径 `/` 和 `/items/{item_id}` 接收 HTTP 请求。
    * 以上两个路径都接受 `GET` 操作(也称为 HTTP 方法)。
    * 路径 `/items/{item_id}` 有一个应为 `int` 的路径参数 `item_id`。
    * 路径 `/items/{item_id}` 有一个可选的 `str` 类型查询参数 `q`。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 20.7K bytes
    - Click Count (0)
Back to Top