openapi-generators / openapi-generators/openapi-python-client
Conflicting module names for models silently generate invalid code
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 2k
- Fork
- 293
- Merge trung bình
- 34 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
Describe the bug
I am generating a Python Client using the OpenAPI model of Netbox 3.6.9 (with a few plugins pre-installed).
This schema contains for example a model VLAN and a model Vlan.
However, in the generated client, only the model Vlan is generated, but the models/__init__.py still tries to import VLAN.
OpenAPI Spec File
https://gist.github.com/linkdd/3193453b38357d190545c7988cdac692
Desktop:
- OS: Debian 12
- Python Version: 3.12
- openapi-python-client version 0.21.6
Additional context
At $day_job, it was a blocking point, we had to remove temporarily the dependency to the generated client. I added a few tasks to my backlog in order to tackle this issue myself and ideally come up with a PR, but it won't be soon. Any help or information on how/where the model generation actually happens would be awesome and a huge time saver.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Tái hiện quá trình sinh mã bằng đặc tả Netbox OpenAPI được liên kết và kiểm tra các model đã được sinh cùng với models/init.py. Theo dõi đường dẫn sinh model để xem VLAN và Vlan được đặt tên như thế nào, sau đó bổ sung coverage cho thấy cả các model đã được sinh lẫn các import của chúng vẫn hợp lệ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- tooling
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100