Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 578 for name (0.14 sec)

  1. tests/test_validate_response_recursive/test_validate_response_recursive_pv2.py

        assert response.json() == {
            "sub_items": [{"name": "subitem", "sub_items": []}],
            "name": "item",
        }
    
        response = client.get("/items/recursive-submodel")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "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
    - 900 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial004.py

            "components": {
                "schemas": {
                    "Item": {
                        "title": "Item",
                        "required": ["name", "price"],
                        "type": "object",
                        "properties": {
                            "name": {"title": "Name", "type": "string"},
                            "description": {
                                "title": "Description",
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 8.7K bytes
    - Viewed (0)
  3. tests/test_validate_response_dataclass.py

    app = FastAPI()
    
    
    @dataclass
    class Item:
        name: str
        price: Optional[float] = None
        owner_ids: Optional[List[int]] = None
    
    
    @app.get("/items/invalid", response_model=Item)
    def get_invalid():
        return {"name": "invalid", "price": "foo"}
    
    
    @app.get("/items/innerinvalid", response_model=Item)
    def get_innerinvalid():
        return {"name": "double invalid", "price": "foo", "owner_ids": ["foo", "bar"]}
    
    
    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_separate_openapi_schemas/test_tutorial001_py39.py

    
    @needs_py39
    def test_read_items(client: TestClient) -> None:
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [
            {
                "name": "Portal Gun",
                "description": "Device to travel through the multi-rick-verse",
            },
            {"name": "Plumbus", "description": None},
        ]
    
    
    @needs_py39
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_schema_extra_example/test_tutorial005_an_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: Sat Aug 26 18:03:13 GMT 2023
    - 6.8K bytes
    - Viewed (0)
  6. docs_src/bigger_applications/app/routers/items.py

    )
    
    
    fake_items_db = {"plumbus": {"name": "Plumbus"}, "gun": {"name": "Portal Gun"}}
    
    
    @router.get("/")
    async def read_items():
        return fake_items_db
    
    
    @router.get("/{item_id}")
    async def read_item(item_id: str):
        if item_id not in fake_items_db:
            raise HTTPException(status_code=404, detail="Item not found")
        return {"name": fake_items_db[item_id]["name"], "item_id": item_id}
    
    
    @router.put(
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sun Nov 29 17:32:18 GMT 2020
    - 1011 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_body_updates/test_tutorial001.py

    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.body_updates.tutorial001 import app
    
        client = TestClient(app)
        return client
    
    
    def test_get(client: TestClient):
        response = client.get("/items/baz")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "name": "Baz",
            "description": None,
            "price": 50.2,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 11.8K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_body_updates/test_tutorial001_py310.py

    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.body_updates.tutorial001_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_get(client: TestClient):
        response = client.get("/items/baz")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "name": "Baz",
            "description": None,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 11.8K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_handling_errors/test_tutorial003.py

                        "summary": "Read Unicorn",
                        "operationId": "read_unicorn_unicorns__name__get",
                        "parameters": [
                            {
                                "required": True,
                                "schema": {"title": "Name", "type": "string"},
                                "name": "name",
                                "in": "path",
                            }
                        ],
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py310.py

            "components": {
                "schemas": {
                    "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: Thu Apr 18 19:40:57 GMT 2024
    - 9.5K bytes
    - Viewed (0)
Back to top