Feature Request: Add Configurable Network Timeouts to HTTP Clients
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 56/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- python
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start by locating the initialization methods for Client, AsyncClient, OauthClient, and AsyncOauthClient, then check how they construct or accept httpx clients. Trace the existing README.md examples and project tests for custom client behavior. Done means all four clients support the documented timeout setting, custom httpx client settings remain intact, and the updated examples are included.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The Problem
By default, the underlying httpx HTTP library used by this SDK applies a strict 5-second timeout to all network requests.
If an API method takes longer than 5 seconds to process-for example, generating a large PDF file, querying a heavy dataset, or doing operations over a slow network connection-the SDK will unexpectedly crash with a TimeoutException.
Currently, the only way for developers to fix this is to understand how httpx works underneath, build a custom httpx.Client() object with a custom timeout, and explicitly pass it into our SDK upon initialization. This is a bit too much boilerplate work for such a common requirement.
Proposed Solution
We should add a built-in timeout parameter directly into the initialization methods of all our clients (Client, AsyncClient, OauthClient, and AsyncOauthClient), giving it a safer default limit of 30.0 seconds.
Expected behavior:
# Before: Developers had to do all this
import httpx
custom_client = httpx.Client(timeout=60.0)
client = Client(token="abc", client=custom_client)
# After: Simple, clean SDK syntax
client = Client(token="abc", timeout=60.0)
Acceptance Criteria
- Add
timeout: float = 30.0toClientandAsyncClient. - Add
timeout: float = 30.0toOauthClientandAsyncOauthClient. - Pass this parameter into the underlying
httpxclient natively. - Ensure full backward compatibility—if a user manually passes a custom
httpxclient, their settings are preserved and not overridden. - Update
README.mdand PyPI docs with code examples showing how to configure the timeout. - Verify all existing unit tests pass cleanly.
Why this matters / Benefits
- Smarter Defaults: Bumping the default timeout from 5 to 30 seconds prevents the SDK from crashing during heavier, perfectly valid API workloads.
- Better Developer Experience (DX): Allows users to configure timeouts cleanly in one line of code without needing to learn the intricacies of the underlying
httpxlibrary.
- Ngôn ngữ chính
- Python
- Star
- 18
- Fork
- 4
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc 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.
Issue khác của openapi/openapi-python-sdk
-
Rename package to openapi-sdk (PyPI approval in progress)Có thể đã có người làm @francescobianco đã nhận 107 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 15/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
openapi/openapi-python-sdk#20 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
-
good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
openapi/openapi-python-sdk#9 · 7 bình luận ·
Tất cả issue của openapi/openapi-python-sdk
Issue tương tự
-
Agentic
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Imbad0202/academic-research-skills#979 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
reflex-dev/reflex#7561 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
prometheus-community/ansible#906 · 2 bình luận ·