Skip to content

Commit 0f46d1e

Browse files
authored
Merge pull request #26 from mobsuccess-devops/fix/pydantic-v2-warning
fix: Pydantic v2 warning on deprecated `__fields__` BaseModel property access
2 parents aba40cb + 4bbe4d1 commit 0f46d1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

automapper/extensions/pydantic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
def spec_function(target_cls: Type[BaseModel]) -> Iterable[str]:
8-
return (field_name for field_name in getattr(target_cls, "__fields__"))
8+
return (field_name for field_name in target_cls.model_fields)
99

1010

1111
def extend(mapper: Mapper) -> None:

0 commit comments

Comments
 (0)