File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -434,6 +434,12 @@ def _fetch_schema(self, fetchSchemaParam: _FetchSchemaParam = None) -> None:
434434 content = f .read ()
435435 os .remove (temp_model_path )
436436
437+ content = re .sub (
438+ r"(UUID = Field\(...)" ,
439+ r"UUID = Field(default_factory=uuid4" ,
440+ content ,
441+ ) # enable default value for uuid
442+
437443 if fetchSchemaParam .mode == "replace" :
438444 header = (
439445 "from uuid import uuid4\n "
@@ -450,12 +456,6 @@ def _fetch_schema(self, fetchSchemaParam: _FetchSchemaParam = None) -> None:
450456 1 ,
451457 ) # add header before first class declaration
452458
453- content = re .sub (
454- r"(UUID = Field\(...)" ,
455- r"UUID = Field(default_factory=uuid4" ,
456- content ,
457- ) # enable default value for uuid
458-
459459 with open (result_model_path , "w" , encoding = "utf-8" ) as f :
460460 f .write (content )
461461
You can’t perform that action at this time.
0 commit comments