feat: fixes error of multiple forwardref with same name

This commit is contained in:
2025-11-23 21:40:54 -03:00
parent b31c990b54
commit f80a1bbda3
2 changed files with 51 additions and 4 deletions

View File

@@ -29,11 +29,11 @@ class OneOfTypeParser(GenericTypeParser):
mapped_properties = self.mappings_properties_builder(properties, **kwargs)
sub_properties = properties["oneOf"]
sub_types = [
GenericTypeParser.type_from_properties(name, subProperty, **kwargs)
for subProperty in sub_properties
GenericTypeParser.type_from_properties(
f"{name}_sub{i}", subProperty, **kwargs
)
for i, subProperty in enumerate(properties["oneOf"])
]
if not kwargs.get("required", False):