openapi-generators / openapi-generators/openapi-python-client
$ref in path parameters doesn't seem to work
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
If a get path has a parameter using $ref to point to #/components/parameters, the generated API lacks the corresponding kwarg. If one "hoists" the indirect parameter up into the path's parameters, it works as expected.
To Reproduce
See this repo for a reproducible example.
And see this repo for the same schema without the $ref, working as expected.
Expected behavior
I expect to see the optional page kwarg in both generated APIs.
I see this in the $ref example:
def sync(
*,
client: Client,
) -> Optional[List[str]]:
and this in the noref example:
def sync(
*,
client: Client,
page: Union[Unset, None, GetTestPage] = UNSET,
) -> Optional[List[str]]:
OpenAPI Spec File
A link to your openapi.json which produces this issue.
Desktop (please complete the following information):
- OS: Microsoft Windows 10 Pro 10.0.19044 Build 19044
- Python Version: 3.9.12
- openapi-python-client version 0.11.1
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
Bắt đầu với test-schema.yaml được liên kết trong repository có thể tái lập openapi-ref-issue và chạy generator bằng phiên bản openapi-python-client được báo cáo. So sánh entry point sync được tạo với ví dụ noref, tập trung vào việc phân giải tham số $ref. Được xem là hoàn tất khi API được tạo cũng bao gồm page kwarg tùy chọn trong trường hợp tham số được tham chiếu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- openapi, python
- Lĩnh vực
- api
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 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
- 48/100