openapi-generators / openapi-generators/openapi-python-client
Name conflict between `models.Response` and `types.Response`
未關閉
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 2k
- 分支
- 293
- 平均合併
- 34 分鐘
- 30 天內合併 PR
- 1
描述
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.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先追蹤產生的模型以及 types.py 中的類別是如何命名和匯入的。使用包含 Response 型別的 OpenAPI 規範重現該衝突,然後驗證產生的 Python 匯入不再發生衝突,同時 class_overrides 仍可使用。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- openapi, python
- 領域
- tooling
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100