feat: tests that the generated fields in the oneOf parser have unique names and applies the same logic to the anyOf parser

This commit is contained in:
2025-11-23 22:09:55 -03:00
parent f80a1bbda3
commit f15913c58e
2 changed files with 13 additions and 13 deletions

View File

@@ -30,8 +30,10 @@ class AnyOfTypeParser(GenericTypeParser):
sub_properties = properties["anyOf"]
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(sub_properties)
]
if not kwargs.get("required", False):