Feature/oneof unique subtypes naming #58
Reference in New Issue
Block a user
Delete Branch "feature/oneof-unique-subtypes-naming"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Solves #55
This pull request updates how subtypes are named when parsing
anyOfandoneOfconstructs in JSON schemas, ensuring that each generated subtype has a unique name. This change improves type clarity and avoids potential naming collisions in generated models. Additionally, a new test verifies that subtypes created from aoneOfschema have distinct names.Improvements to subtype naming in parsers:
AnyOfTypeParserandOneOfTypeParserto generate unique subtype names by appending an index to the base name (e.g.,name_sub0,name_sub1) when parsing subtypes from the schema. [1] [2]Test enhancements:
test_scoped_ref_schematotests/test_schema_converter.pythat verifies subtypes generated from aoneOfschema have different names, preventing type name conflicts.JSONSchemaandget_argsfor improved type handling in test cases.