Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for kobelb (0.68 sec)

  1. tests/test_filter_pydantic_sub_model_pv2.py

        from pydantic import BaseModel, ValidationInfo, field_validator
    
        app = FastAPI()
    
        class ModelB(BaseModel):
            username: str
    
        class ModelC(ModelB):
            password: str
    
        class ModelA(BaseModel):
            name: str
            description: Optional[str] = None
            foo: ModelB
    
            @field_validator("name")
            def lower_username(cls, name: str, info: ValidationInfo):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  2. tests/test_filter_pydantic_sub_model/app_pv1.py

    from fastapi import Depends, FastAPI
    from pydantic import BaseModel, validator
    
    app = FastAPI()
    
    
    class ModelB(BaseModel):
        username: str
    
    
    class ModelC(ModelB):
        password: str
    
    
    class ModelA(BaseModel):
        name: str
        description: Optional[str] = None
        model_b: ModelB
    
        @validator("name")
        def lower_username(cls, name: str, values):
            if not name.endswith("A"):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 784 bytes
    - Viewed (0)
  3. tests/test_filter_pydantic_sub_model/test_filter_pydantic_sub_model_pv1.py

                            "description": {"title": "Description", "type": "string"},
                            "model_b": {"$ref": "#/components/schemas/ModelB"},
                        },
                    },
                    "ModelB": {
                        "title": "ModelB",
                        "required": ["username"],
                        "type": "object",
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.5K bytes
    - Viewed (0)
Back to top