Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 826 for name (0.14 sec)

  1. tests/test_serialize_response_model.py

        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),
            "k3": Item(aliased_name="baz", price=2.0, owner_ids=[1, 2, 3]),
        }
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 4.2K bytes
    - Viewed (0)
  2. tests/test_validate_response_recursive/app_pv1.py

    @app.get("/items/recursive", response_model=RecursiveItem)
    def get_recursive():
        return {"name": "item", "sub_items": [{"name": "subitem", "sub_items": []}]}
    
    
    @app.get("/items/recursive-submodel", response_model=RecursiveItemViaSubmodel)
    def get_recursive_submodel():
        return {
            "name": "item",
            "sub_items1": [
                {
                    "name": "subitem",
                    "sub_items2": [
                        {
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  3. tests/test_validate_response_recursive/app_pv2.py

    @app.get("/items/recursive", response_model=RecursiveItem)
    def get_recursive():
        return {"name": "item", "sub_items": [{"name": "subitem", "sub_items": []}]}
    
    
    @app.get("/items/recursive-submodel", response_model=RecursiveItemViaSubmodel)
    def get_recursive_submodel():
        return {
            "name": "item",
            "sub_items1": [
                {
                    "name": "subitem",
                    "sub_items2": [
                        {
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_dataclasses/test_tutorial003.py

        response = client.post(
            "/authors/foo/items/",
            json=[{"name": "Bar"}, {"name": "Baz", "description": "Drop the Baz"}],
        )
        assert response.status_code == 200
        assert response.json() == {
            "name": "foo",
            "items": [
                {"name": "Bar", "description": None},
                {"name": "Baz", "description": "Drop the Baz"},
            ],
        }
    
    
    def test_get_authors():
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 12.1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_dependencies/test_tutorial004_an.py

                    "items": [
                        {"item_name": "Foo"},
                        {"item_name": "Bar"},
                        {"item_name": "Baz"},
                    ]
                },
            ),
            (
                "/items?q=foo",
                200,
                {
                    "items": [
                        {"item_name": "Foo"},
                        {"item_name": "Bar"},
                        {"item_name": "Baz"},
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 5.4K bytes
    - Viewed (0)
  6. 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
            return item
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 705 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_schema_extra_example/test_tutorial004_py310.py

                        },
                    },
                    "Item": {
                        "title": "Item",
                        "required": ["name", "price"],
                        "type": "object",
                        "properties": {
                            "name": {"title": "Name", "type": "string"},
                            "description": IsDict(
                                {
                                    "title": "Description",
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 7.1K bytes
    - Viewed (0)
  8. docs_src/python_types/tutorial003.py

    def get_name_with_age(name: str, age: int):
        name_with_age = name + " is this old: " + age
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 119 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_schema_extra_example/test_tutorial004.py

                        },
                    },
                    "Item": {
                        "title": "Item",
                        "required": ["name", "price"],
                        "type": "object",
                        "properties": {
                            "name": {"title": "Name", "type": "string"},
                            "description": IsDict(
                                {
                                    "title": "Description",
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 6.9K bytes
    - Viewed (0)
  10. tests/test_custom_schema_fields.py

    
    @app.get("/foo", response_model=Item)
    def foo():
        return {"name": "Foo item"}
    
    
    client = TestClient(app)
    
    
    item_schema = {
        "title": "Item",
        "required": ["name"],
        "type": "object",
        "x-something-internal": {
            "level": 4,
        },
        "properties": {
            "name": {
                "title": "Name",
                "type": "string",
            }
        },
    }
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.2K bytes
    - Viewed (0)
Back to top