Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 3,476 for item$ (0.04 sec)

  1. tests/test_tutorial/test_response_model/test_tutorial006.py

    client = TestClient(app)
    
    
    def test_read_item_name():
        response = client.get("/items/bar/name")
        assert response.status_code == 200, response.text
        assert response.json() == {"name": "Bar", "description": "The Bar fighters"}
    
    
    def test_read_item_public_data():
        response = client.get("/items/bar/public")
        assert response.status_code == 200, response.text
        assert response.json() == {
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Aug 04 20:47:07 UTC 2023
    - 6K bytes
    - Viewed (0)
  2. tests/test_union_body.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: Optional[str] = None
    
    
    class OtherItem(BaseModel):
        price: int
    
    
    @app.post("/items/")
    def save_union_body(item: Union[OtherItem, Item]):
        return {"item": item}
    
    
    client = TestClient(app)
    
    
    def test_post_other_item():
        response = client.post("/items/", json={"price": 100})
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  3. docs_src/body_fields/tutorial001_an_py310.py

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = Field(
            default=None, title="The description of the item", max_length=300
        )
        price: float = Field(gt=0, description="The price must be greater than zero")
        tax: float | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Annotated[Item, Body(embed=True)]):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 563 bytes
    - Viewed (0)
  4. guava-testlib/src/com/google/common/testing/RelationshipTester.java

        Item<T> itemInfo = getItem(groupNumber, itemNumber);
        Item<T> relatedInfo = getItem(groupNumber, relatedItemNumber);
    
        T item = itemInfo.value;
        T related = relatedInfo.value;
        assertWithTemplate(
            "$ITEM must be $RELATIONSHIP to $OTHER",
            itemInfo,
            relatedInfo,
            equivalence.equivalent(item, related));
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Apr 25 11:57:12 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  5. tests/test_serialize_response_model.py

    @app.get("/items/validlist", response_model=List[Item])
    def get_validlist():
        return [
            Item(aliased_name="foo"),
            Item(aliased_name="bar", price=1.0),
            Item(aliased_name="baz", price=2.0, owner_ids=[1, 2, 3]),
        ]
    
    
    @app.get("/items/validdict", response_model=Dict[str, Item])
    def get_validdict():
        return {
            "k1": Item(aliased_name="foo"),
            "k2": Item(aliased_name="bar", price=1.0),
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 4.2K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_body_fields/test_tutorial001_an.py

    def test_items_5(client: TestClient):
        response = client.put("/items/5", json={"item": {"name": "Foo", "price": 3.0}})
        assert response.status_code == 200
        assert response.json() == {
            "item_id": 5,
            "item": {"name": "Foo", "price": 3.0, "description": None, "tax": None},
        }
    
    
    def test_items_6(client: TestClient):
        response = client.put(
            "/items/6",
            json={
                "item": {
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_body_fields/test_tutorial001_an_py39.py

        response = client.put("/items/5", json={"item": {"name": "Foo", "price": 3.0}})
        assert response.status_code == 200
        assert response.json() == {
            "item_id": 5,
            "item": {"name": "Foo", "price": 3.0, "description": None, "tax": None},
        }
    
    
    @needs_py39
    def test_items_6(client: TestClient):
        response = client.put(
            "/items/6",
            json={
                "item": {
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/conc_alloc.go

    	for idx, item := range classes {
    		target := item.target
    		if item.lowerBound < 0 {
    			return nil, 0, fmt.Errorf("lower bound %d is %v but negative lower bounds are not allowed", idx, item.lowerBound)
    		}
    		if target < item.lowerBound {
    			return nil, 0, fmt.Errorf("target %d is %v, which is below its lower bound of %v", idx, target, item.lowerBound)
    		}
    		if item.upperBound < item.lowerBound {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Dec 18 04:27:38 UTC 2022
    - 9.5K bytes
    - Viewed (0)
  9. docs_src/additional_status_codes/tutorial001_an_py39.py

    app = FastAPI()
    
    items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}}
    
    
    @app.put("/items/{item_id}")
    async def upsert_item(
        item_id: str,
        name: Annotated[Union[str, None], Body()] = None,
        size: Annotated[Union[int, None], Body()] = None,
    ):
        if item_id in items:
            item = items[item_id]
            item["name"] = name
            item["size"] = size
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 705 bytes
    - Viewed (0)
  10. tests/test_tutorial/test_schema_extra_example/test_tutorial001_pv1.py

            "paths": {
                "/items/{item_id}": {
                    "put": {
                        "summary": "Update Item",
                        "operationId": "update_item_items__item_id__put",
                        "parameters": [
                            {
                                "required": True,
                                "schema": {"type": "integer", "title": "Item Id"},
                                "name": "item_id",
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.4K bytes
    - Viewed (0)
Back to top