Skip to content

feat: add aiohttp support, retry on connection errors, and path param encoding - #30

Closed
fern-api[bot] wants to merge 1 commit into
mainfrom
fern-bot/2026-04-13T21-22Z
Closed

fern-api[bot] wants to merge 1 commit into
mainfrom
fern-bot/2026-04-13T21-22Z

Conversation

@fern-api

@fern-api fern-api Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Version Bump: New capabilities added (aiohttp transport extra, DefaultAioHttpClient/DefaultAsyncHttpxClient classes, connection-error retry behavior, encode_path_param utility) and the minimum Python version was raised from 3.8 to 3.10, which is a behavioral/compatibility change for consumers on older runtimes.

The SDK now supports an optional aiohttp transport backend for async clients. Install it with pip install newscatcher-sdk[aiohttp] and use the new DefaultAioHttpClient class as your async HTTP client. Two new convenience classes, DefaultAioHttpClient and DefaultAsyncHttpxClient, are exported from the top-level package with sensible defaults (60 s timeout, redirects enabled). The async and sync HTTP clients now automatically retry requests that fail with connection-level errors (ConnectError, RemoteProtocolError) using exponential backoff, in addition to the existing server-error retry logic. Note: Python 3.8 and 3.9 are no longer supported; the minimum required version is now Python 3.10.

… encoding

Introduces optional aiohttp transport backend, automatic retry on
connection-level errors, and improved URL path parameter encoding.
The minimum supported Python version is now 3.10.

Key changes:
- Add optional `aiohttp` extra (`pip install newscatcher-sdk[aiohttp]`)
  with `DefaultAioHttpClient` and `DefaultAsyncHttpxClient` helper classes
- Automatically retry requests on `httpx.ConnectError` and
  `httpx.RemoteProtocolError` using exponential backoff with jitter
- Introduce `_make_default_async_client` factory that prefers
  `httpx_aiohttp` when available, falling back to plain `httpx.AsyncClient`
- Add `encode_path_param` utility that correctly lowercases Python booleans
  (`True` → `"true"`) in URL path segments
- Add `_retry_timeout_from_retries` helper for backoff when no HTTP
  response is available
- Drop Python 3.8 and 3.9 support; minimum is now Python 3.10
- Pin `pydantic-core` upper bound to `<2.44.0`
- Add rich docstring documentation to all public type aliases

🌿 Generated with Fern
@oscatcher oscatcher closed this Apr 23, 2026
@oscatcher
oscatcher deleted the fern-bot/2026-04-13T21-22Z branch May 1, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant