Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feature Request: Add Configurable Network Timeouts to HTTP Clients

Aperta
#18 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
56/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
python

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.0 to Client and AsyncClient.
  • Add timeout: float = 30.0 to OauthClient and AsyncOauthClient.
  • Pass this parameter into the underlying httpx client natively.
  • Ensure full backward compatibility—if a user manually passes a custom httpx client, their settings are preserved and not overridden.
  • Update README.md and 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 httpx library.
Lingua principale
Python
Stelle
18
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openapi/openapi-python-sdk

Tutte le issue di openapi/openapi-python-sdk

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.