Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 16 of 16 for Page (0.18 sec)

  1. tests/test_response_model_include_exclude.py

    from pydantic import BaseModel
    
    
    class Model1(BaseModel):
        foo: str
        bar: str
    
    
    class Model2(BaseModel):
        ref: Model1
        baz: str
    
    
    class Model3(BaseModel):
        name: str
        age: int
        ref2: Model2
    
    
    app = FastAPI()
    
    
    @app.get(
        "/simple_include",
        response_model=Model2,
        response_model_include={"baz": ..., "ref": {"foo"}},
    )
    def simple_include():
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Jul 19 19:14:58 GMT 2021
    - 4K bytes
    - Viewed (0)
  2. tests/test_multi_body_errors.py

                        "loc": ["body", 0, "age"],
                        "msg": "ensure this value is greater than 0",
                        "type": "value_error.number.not_gt",
                    }
                ]
            }
        )
    
    
    def test_put_incorrect_body_multiple():
        response = client.post("/items/", json=[{"age": "five"}, {"age": "six"}])
        assert response.status_code == 422, response.text
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  3. docs_src/python_types/tutorial004.py

    def get_name_with_age(name: str, age: int):
        name_with_age = name + " is this old: " + str(age)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 124 bytes
    - Viewed (0)
  4. 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 May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 119 bytes
    - Viewed (0)
  5. docs_src/python_types/tutorial012.py

    from typing import Optional
    
    from pydantic import BaseModel
    
    
    class User(BaseModel):
        name: str
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 122 bytes
    - Viewed (0)
  6. fastapi/routing.py

                self.secure_cloned_response_field = None
            self.dependencies = list(dependencies or [])
            self.description = description or inspect.cleandoc(self.endpoint.__doc__ or "")
            # if a "form feed" character (page break) is found in the description text,
            # truncate description text to the content preceding the first "form feed"
            self.description = self.description.split("\f")[0].strip()
            response_fields = {}
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
Back to top