openapi-generators / openapi-generators/openapi-python-client
Name conflict between `models.Response` and `types.Response`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2k
- Forks
- 293
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Description
I ran into an OpenAPI spec which included a Response type. That caused a name conflict in the generated python code:
from ...models.response import Response
from ...types import Response
This was fixed easily enough using a class_overrides config, but since the classes in types.py are pretty generic I think it would be better if the classes were just fully qualified to avoid this kind of conflict.
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 by tracing how generated models and the classes in types.py are named and imported. Reproduce the conflict with an OpenAPI spec containing a Response type, then verify that generated Python imports no longer collide while class_overrides remains usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100