Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 121 - 130 of 378 for item_1 (0.08 seconds)

  1. tests/test_tutorial/test_query_params_str_validations/test_tutorial009.py

            "items": [{"item_id": "Foo"}, {"item_id": "Bar"}],
            "q": "fixedquery",
        }
    
    
    def test_query_params_str_validations_q_fixedquery(client: TestClient):
        response = client.get("/items/", params={"q": "fixedquery"})
        assert response.status_code == 200
        assert response.json() == {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
    
    
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Dec 26 10:43:02 GMT 2025
    - 4.3K bytes
    - Click Count (0)
  2. 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",
                                    "type": "integer",
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Dec 26 10:43:02 GMT 2025
    - 5.5K bytes
    - Click Count (0)
  3. docs/de/docs/index.md

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
        is_offer: Union[bool, None] = None
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[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 Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Dec 26 09:39:53 GMT 2025
    - 25.8K bytes
    - Click Count (1)
  4. docs_src/query_params_str_validations/tutorial001_py310.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: str | None = None):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 239 bytes
    - Click Count (0)
  5. docs_src/body/tutorial003_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    app = FastAPI()
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 330 bytes
    - Click Count (0)
  6. tests/test_extra_routes.py

    def delete_item(item_id: str, item: Item):
        return {"item_id": item_id, "item": item}
    
    
    @app.head("/items/{item_id}")
    def head_item(item_id: str):
        return JSONResponse(None, headers={"x-fastapi-item-id": item_id})
    
    
    @app.options("/items/{item_id}")
    def options_item(item_id: str):
        return JSONResponse(None, headers={"x-fastapi-item-id": item_id})
    
    
    @app.patch("/items/{item_id}")
    def patch_item(item_id: str, item: Item):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 13.5K bytes
    - Click Count (0)
  7. docs_src/query_params_str_validations/tutorial009_py310.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: str | None = Query(default=None, alias="item-query")):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 281 bytes
    - Click Count (0)
  8. docs_src/path_params_numeric_validations/tutorial002_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, Path
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(
        q: str, item_id: Annotated[int, Path(title="The ID of the item to get")]
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 311 bytes
    - Click Count (0)
  9. docs_src/path_params_numeric_validations/tutorial003_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, Path
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(
        item_id: Annotated[int, Path(title="The ID of the item to get")], q: str
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 311 bytes
    - Click Count (0)
  10. docs_src/query_params_str_validations/tutorial004_py310.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: str | None = Query(
            default=None, min_length=3, max_length=50, pattern="^fixedquery$"
        ),
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 335 bytes
    - Click Count (0)
Back to Top