Feature Request / Question: Organize models into subdirectories by tag or prefix or something else(similar to API structure) #1391
paketeserrano
started this conversation in
Feature request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Current Behavior
The generator currently organizes API endpoints into subdirectories based on OpenAPI tags:
api/ file_storage/ create_service.py list_services.py firewall_ruleset/ create_ruleset.py kubernetes/ create_cluster.pyHowever, all models are generated in a flat structure:
models/ __init__.py service.py service_create.py ruleset.py ruleset_create.py cluster.py (209 model files...)Desired Behavior
I would like models to be organized similarly to API endpoints:
models/ file_storage/ __init__.py service.py service_create.py firewall_ruleset/ __init__.py ruleset.py ruleset_create.pyThis would provide better organization for large APIs with many schemas, making it easier to navigate and understand which models belong to which API domains.
Question
Is there currently any way to achieve this through:
Context
I'm working with an API that has ~210 schemas across 6 different domains. The flat structure makes navigation difficult, especially since many schemas have similar naming patterns. I'm currently using prefixes (e.g., FileStorageService, FirewallRulesetService) to avoid conflicts, but subdirectories would be more intuitive.
Technical Considerations I'm Aware Of
Additional context (optional section):
Generator version: 0.28.1
Python version: 3.12
OpenAPI version: 3.1.0
Beta Was this translation helpful? Give feedback.
All reactions