swagger-api / swagger-api/swagger-codegen
[Python] Import error for models with multiple equivalently named objects.
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
When the schema contains multiple objects that have the same name, python removes an underscore in part of the import statement, causing the import to fail.
Swagger-codegen version
2.3.1
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Could be related to this.
Suggest a fix/enhancement
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with swagger-codegen 2.3.1 and reproduce the report using a schema containing multiple equivalently named objects. Trace the Python model import generation and identify where an underscore is removed; done means generated imports preserve the names needed to load all models. No source file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100