Skip to content

0.3.0 — pydantic as an optional extra

Choose a tag to compare

@lesnik512 lesnik512 released this 04 Jun 20:40
1222c64

Breaking changes

  • pydantic is no longer a required dependency. It moved from [project] dependencies to [project.optional-dependencies]. Install it explicitly: pip install httpware[pydantic]. The httpware[all] extra continues to include it.
  • httpware.PydanticDecoder is no longer re-exported from the top-level package. Import directly from the submodule: from httpware.decoders.pydantic import PydanticDecoder. This mirrors the existing MsgspecDecoder import path.
  • AsyncClient() with decoder=None and no pydantic extra raises ImportError at __init__. Pass decoder=MsgspecDecoder() or install httpware[pydantic] to keep the default behavior.

Other changes

  • tests/test_decoders_pydantic.py adds parametrized payload-edge tests that pin current pydantic-core behavior for b"", b"null", b"{}", malformed JSON, and invalid UTF-8.
  • tests/test_optional_extras_isolation.py now covers both pydantic and msgspec via fresh-subprocess import httpware checks.
  • README freshness pass: status line corrected from "0.1.0 alpha" to "0.3.0"; post-pivot framing replaces the pre-pivot description; RecordedTransport reference removed.

Migration

# 0.2.0
from httpware import AsyncClient, PydanticDecoder

async with AsyncClient(base_url="https://api.example.com") as client:
    user = await client.get("/users/1", response_model=User)
# 0.3.0 — option 1: install the extra, code unchanged
# pip install httpware[pydantic]
from httpware import AsyncClient

async with AsyncClient(base_url="https://api.example.com") as client:
    user = await client.get("/users/1", response_model=User)

# 0.3.0 — option 2: import PydanticDecoder from the submodule
from httpware import AsyncClient
from httpware.decoders.pydantic import PydanticDecoder

async with AsyncClient(decoder=PydanticDecoder()) as client:
    user = await client.get("/users/1", response_model=User)

What's next

Epic 3 (resilience middleware — retry, timeout, bulkhead) and Epic 5 (observability) ship in subsequent releases. See planning/engineering.md §8.