- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for arbitrary_types_allowed (0.07 sec)
-
tests/test_arbitrary_types.py
FakeNumpyArray, WithJsonSchema(TypeAdapter(list[float]).json_schema()), PlainSerializer(lambda v: v.data), ] class MyModel(BaseModel): model_config = ConfigDict(arbitrary_types_allowed=True) custom_field: FakeNumpyArrayPydantic app = FastAPI() @app.get("/") def test() -> MyModel: return MyModel(custom_field=FakeNumpyArray()) client = TestClient(app)Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 3.8K bytes - Viewed (0) -
tests/test_jsonable_encoder.py
model_config = {"arbitrary_types_allowed": True} test_path = PurePath("/foo", "bar") obj = ModelWithPath(path=test_path) assert jsonable_encoder(obj) == {"path": str(test_path)} def test_encode_model_with_pure_posix_path(): class ModelWithPath(BaseModel): path: PurePosixPath model_config = {"arbitrary_types_allowed": True}Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 9.2K bytes - Viewed (0) -
tests/test_compat.py
def __bool__(self): return False class EmbeddedModel(BaseModel): model_config = ConfigDict(arbitrary_types_allowed=True) value: Union[str, Missing] = Missing() class Model(BaseModel): model_config = ConfigDict( arbitrary_types_allowed=True, ) value: Union[str, Missing] = Missing() embedded_model: EmbeddedModel = EmbeddedModel()
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 4.2K bytes - Viewed (0) -
tests/test_inherited_custom_class.py
with pytest.raises(TypeError): vars(asyncpg_uuid) return {"fast_uuid": asyncpg_uuid} class SomeCustomClass(BaseModel): model_config = {"arbitrary_types_allowed": True} a_uuid: MyUuid @field_serializer("a_uuid") def serialize_a_uuid(self, v): return str(v) @app.get("/get_custom_class") def return_some_user():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 1.8K bytes - Viewed (0)