- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for model_validate (0.2 sec)
-
docs_src/path_operation_advanced_configuration/tutorial007.py
raw_body = await request.body() try: data = yaml.safe_load(raw_body) except yaml.YAMLError: raise HTTPException(status_code=422, detail="Invalid YAML") try: item = Item.model_validate(data) except ValidationError as e: raise HTTPException(status_code=422, detail=e.errors(include_url=False))
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 822 bytes - Viewed (0) -
tests/test_read_with_orm_mode.py
model_config = {"from_attributes": True} app = FastAPI() @app.post("/people/", response_model=PersonRead) def create_person(person: PersonCreate) -> Any: db_person = Person.model_validate(person) return db_person client = TestClient(app) person_data = {"name": "Dive", "lastname": "Wilson"} response = client.post("/people/", json=person_data) data = response.json()
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 2.4K bytes - Viewed (0) -
.github/actions/people/app/main.py
) graphql_response = DiscussionsResponse.model_validate(data) return graphql_response.data.repository.discussions.edges def get_graphql_pr_edges(*, settings: Settings, after: Union[str, None] = None): data = get_graphql_response(settings=settings, query=prs_query, after=after) graphql_response = PRsResponse.model_validate(data) return graphql_response.data.repository.pullRequests.edges
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 17:38:21 GMT 2024 - 19.2K bytes - Viewed (1) -
docs/en/docs/advanced/path-operation-advanced-configuration.md
``` !!! info In Pydantic version 1 the method to parse and validate an object was `Item.parse_obj()`, in Pydantic version 2, the method is called `Item.model_validate()`. !!! tip Here we re-use the same Pydantic model.
Plain Text - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 7.7K bytes - Viewed (0) -
docs/de/docs/advanced/path-operation-advanced-configuration.md
Plain Text - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 20:27:23 GMT 2024 - 8.5K bytes - Viewed (0)