Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ModelV1 (0.04 sec)

  1. tests/test_jsonable_encoder.py

    def test_json_encoder_error_with_pydanticv1():
        with warnings.catch_warnings():
            warnings.simplefilter("ignore", UserWarning)
            from pydantic import v1
    
        class ModelV1(v1.BaseModel):
            name: str
    
        data = ModelV1(name="test")
        with pytest.raises(PydanticV1NotSupportedError):
            jsonable_encoder(data)
    
    
    def test_encode_model_with_config():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 9.2K bytes
    - Viewed (0)
  2. tests/test_response_model_include_exclude.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    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,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Jul 19 19:14:58 UTC 2021
    - 4K bytes
    - Viewed (0)
Back to top