Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 545 for name (0.16 sec)

  1. tests/test_tutorial/test_body/test_tutorial001.py

        response = client.post("/items/", json={"name": "Foo", "price": 50.5})
        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
            "price": 50.5,
            "description": None,
            "tax": None,
        }
    
    
    def test_post_with_str_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": "50.5"})
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 14.7K bytes
    - Viewed (4)
  2. tests/test_tutorial/test_body/test_tutorial001_py310.py

        response = client.post("/items/", json={"name": "Foo", "price": 50.5})
        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
            "price": 50.5,
            "description": None,
            "tax": None,
        }
    
    
    @needs_py310
    def test_post_with_str_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": "50.5"})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15K bytes
    - Viewed (1)
  3. tests/test_tutorial/test_schema_extra_example/test_tutorial004_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 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 7.1K bytes
    - Viewed (0)
  4. docs_src/response_model/tutorial006.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: float = 10.5
    
    
    items = {
        "foo": {"name": "Foo", "price": 50.2},
        "bar": {"name": "Bar", "description": "The Bar fighters", "price": 62, "tax": 20.2},
        "baz": {
            "name": "Baz",
            "description": "There goes my baz",
            "price": 50.2,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 848 bytes
    - Viewed (0)
  5. tests/test_validate_response.py

            return None
        else:
            return {"name": "invalid", "price": 3.2}
    
    
    @app.get("/items/innerinvalid", response_model=Item)
    def get_innerinvalid():
        return {"name": "double invalid", "price": "foo", "owner_ids": ["foo", "bar"]}
    
    
    @app.get("/items/invalidlist", response_model=List[Item])
    def get_invalidlist():
        return [
            {"name": "foo"},
            {"name": "bar", "price": "bar"},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2K bytes
    - Viewed (0)
  6. tests/test_response_by_alias.py

    @app.get("/no-alias/dict", response_model=ModelNoAlias)
    def no_alias_dict():
        return {"name": "Foo"}
    
    
    @app.get("/no-alias/model", response_model=ModelNoAlias)
    def no_alias_model():
        return ModelNoAlias(name="Foo")
    
    
    @app.get("/no-alias/list", response_model=List[ModelNoAlias])
    def no_alias_list():
        return [{"name": "Foo"}, {"name": "Bar"}]
    
    
    client = TestClient(app)
    
    
    def test_read_dict():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 11.1K bytes
    - Viewed (0)
  7. fastapi/security/http.py

        def __init__(
            self,
            *,
            scheme: str,
            scheme_name: Optional[str] = None,
            description: Optional[str] = None,
            auto_error: bool = True,
        ):
            self.model = HTTPBaseModel(scheme=scheme, description=description)
            self.scheme_name = scheme_name or self.__class__.__name__
            self.auto_error = auto_error
    
        async def __call__(
            self, request: Request
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_schema_extra_example/test_tutorial005_an.py

                        },
                    },
                    "Item": {
                        "title": "Item",
                        "required": ["name", "price"],
                        "type": "object",
                        "properties": {
                            "name": {"title": "Name", "type": "string"},
                            "description": IsDict(
                                {
                                    "title": "Description",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 26 18:03:13 GMT 2023
    - 6.7K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_additional_status_codes/test_tutorial001_an_py310.py

    
    @needs_py310
    def test_create(client: TestClient):
        response = client.put("/items/red", json={"name": "Chillies"})
        assert response.status_code == 201, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 741 bytes
    - Viewed (0)
  10. tests/test_tutorial/test_additional_status_codes/test_tutorial001_an_py39.py

    
    @needs_py39
    def test_create(client: TestClient):
        response = client.put("/items/red", json={"name": "Chillies"})
        assert response.status_code == 201, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 737 bytes
    - Viewed (0)
Back to top