Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ModelWithRef (0.06 sec)

  1. tests/test_schema_ref_pydantic_v2.py

    
    @pytest.fixture(name="client")
    def get_client():
        app = FastAPI()
    
        class ModelWithRef(BaseModel):
            ref: str = Field(validation_alias="$ref", serialization_alias="$ref")
            model_config = ConfigDict(validate_by_alias=True, serialize_by_alias=True)
    
        @app.get("/", response_model=ModelWithRef)
        async def read_root() -> Any:
            return {"$ref": "some-ref"}
    
        client = TestClient(app)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 2.1K bytes
    - Viewed (0)
Back to top