Skip to content

Commit

Permalink
Fix deep copy max recursion failure - pydantic 1.9.1 (#819)
Browse files Browse the repository at this point in the history
* Run test without fix - pydantic 1.9.1

* Run tests with the fix.

Co-authored-by: Eyal Mor <eyal.mor@autodesk.com>
  • Loading branch information
eyal-mor and Eyal Mor authored Aug 11, 2022
1 parent 4ed2336 commit e3dbcc5
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 479 deletions.
1 change: 1 addition & 0 deletions datamodel_code_generator/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def validate_original_name(cls, v: Any, values: Dict[str, Any]) -> str:
class Config:
arbitrary_types_allowed = True
keep_untouched = (cached_property,)
copy_on_model_validation = False

@property
def short_name(self) -> str:
Expand Down
1 change: 1 addition & 0 deletions datamodel_code_generator/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def module_name(self) -> str:
class DataType(_BaseModel):
class Config:
extra = "forbid"
copy_on_model_validation = False

type: Optional[str]
reference: Optional[Reference]
Expand Down
Loading

0 comments on commit e3dbcc5

Please sign in to comment.