Skip to content

Commit 2e35725

Browse files
Use the name if available instead of the default name. (#3126)
This should prevent us from running into the naming collsion that happens when the default_name is already in use for another model.
1 parent 9abe619 commit 2e35725

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.generator/src/generator/formatter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,8 @@ def format_data_with_schema_list(
492492
continue
493493

494494
if name:
495-
one_of_imports.add(f"{default_name}")
496-
value = f"new {default_name}({value})"
495+
one_of_imports.add(f"{name}")
496+
value = f"new {name}({value})"
497497
elif default_name:
498498
one_of_imports.add(f"{default_name}Item")
499499
value = f"new {default_name}Item({value})"

0 commit comments

Comments
 (0)