diff --git a/todo/models/common/pyobjectid.py b/todo/models/common/pyobjectid.py index 935e0ab..67fcadb 100644 --- a/todo/models/common/pyobjectid.py +++ b/todo/models/common/pyobjectid.py @@ -13,7 +13,3 @@ def validate(cls, value, field=None): if value is not None and ObjectId.is_valid(value): return ObjectId(value) raise ValueError(f"Invalid ObjectId: {value}") - - @classmethod - def __get_pydantic_json_schema__(cls, field_schema): - field_schema.update(type="string") diff --git a/todo/tests/unit/models/common/test_pyobjectid.py b/todo/tests/unit/models/common/test_pyobjectid.py index 91381a4..e180708 100644 --- a/todo/tests/unit/models/common/test_pyobjectid.py +++ b/todo/tests/unit/models/common/test_pyobjectid.py @@ -20,11 +20,6 @@ def test_validate_invalid_objectid(self): def test_validate_none(self): self.assertIsNone(PyObjectId.validate(None)) - def test_pydantic_json_schema(self): - field_schema = {} - PyObjectId.__get_pydantic_json_schema__(field_schema) - self.assertEqual(field_schema["type"], "string") - def test_integration_with_pydantic_model(self): class TestModel(BaseModel): id: PyObjectId