Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 4 of 4 for model_validate (0.07 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. docs_src/path_operation_advanced_configuration/tutorial007_py310.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))
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 797 bytes
    - Click Count (0)
  2. 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()
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Dec 27 12:54:56 GMT 2025
    - 1.2K bytes
    - Click Count (0)
  3. scripts/people.py

            cost=data["data"]["rateLimit"]["cost"],
            remaining=data["data"]["rateLimit"]["remaining"],
            reset_at=data["data"]["rateLimit"]["resetAt"],
        )
        graphql_response = DiscussionsResponse.model_validate(data)
        return graphql_response.data.repository.discussions.edges
    
    
    class DiscussionExpertsResults(BaseModel):
        commenters: Counter[str]
        last_month_commenters: Counter[str]
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Mar 23 13:51:24 GMT 2026
    - 15K bytes
    - Click Count (0)
  4. fastapi/sse.py

    from typing import Annotated, Any
    
    from annotated_doc import Doc
    from pydantic import AfterValidator, BaseModel, Field, model_validator
    from starlette.responses import StreamingResponse
    
    # Canonical SSE event schema matching the OpenAPI 3.2 spec
    # (Section 4.14.4 "Special Considerations for Server-Sent Events")
    _SSE_EVENT_SCHEMA: dict[str, Any] = {
        "type": "object",
        "properties": {
            "data": {"type": "string"},
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 09:21:52 GMT 2026
    - 6.2K bytes
    - Click Count (0)
Back to Top