Skip to content

Commit 16f27ef

Browse files
authored
Fix set/frozenset duplicate output in x-python-type serialization (#2849)
1 parent 2aebb77 commit 16f27ef

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/datamodel_code_generator/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,8 @@ def _init_preserved_type_origins() -> dict[type, str]:
608608
from collections.abc import Set as AbstractSet # noqa: PLC0415
609609

610610
return {
611-
set: "Set",
612-
frozenset: "FrozenSet",
611+
set: "set",
612+
frozenset: "frozenset",
613613
AbstractSet: "AbstractSet",
614614
ABCMutableSet: "MutableSet",
615615
ABCMapping: "Mapping",

src/datamodel_code_generator/parser/jsonschema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,9 @@ class decorator which does not preserve staticmethod descriptors.
12871287

12881288
type_to_flag: dict[str, dict[str, bool]] = {
12891289
"Set": {"is_set": True},
1290+
"set": {"is_set": True},
12901291
"FrozenSet": {"is_frozen_set": True},
1292+
"frozenset": {"is_frozen_set": True},
12911293
"Mapping": {"is_mapping": True},
12921294
"MutableMapping": {"is_mapping": True},
12931295
"Sequence": {"is_sequence": True},

0 commit comments

Comments
 (0)