|
| 1 | +# httpware 0.3.0 — pydantic as an optional extra |
| 2 | + |
| 3 | +## Breaking changes |
| 4 | + |
| 5 | +- **`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. |
| 6 | +- **`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. |
| 7 | +- **`AsyncClient()` with `decoder=None` and no pydantic extra raises `ImportError` at `__init__`.** Pass `decoder=MsgspecDecoder()` or install `httpware[pydantic]` to keep the default behavior. |
| 8 | + |
| 9 | +## Other changes |
| 10 | + |
| 11 | +- `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. |
| 12 | +- `tests/test_optional_extras_isolation.py` now covers both pydantic and msgspec via fresh-subprocess `import httpware` checks. |
| 13 | +- 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. |
| 14 | + |
| 15 | +## Migration |
| 16 | + |
| 17 | +```python |
| 18 | +# 0.2.0 |
| 19 | +from httpware import AsyncClient, PydanticDecoder |
| 20 | + |
| 21 | +async with AsyncClient(base_url="https://api.example.com") as client: |
| 22 | + user = await client.get("/users/1", response_model=User) |
| 23 | +``` |
| 24 | + |
| 25 | +```python |
| 26 | +# 0.3.0 — option 1: install the extra, code unchanged |
| 27 | +# pip install httpware[pydantic] |
| 28 | +from httpware import AsyncClient |
| 29 | + |
| 30 | +async with AsyncClient(base_url="https://api.example.com") as client: |
| 31 | + user = await client.get("/users/1", response_model=User) |
| 32 | + |
| 33 | +# 0.3.0 — option 2: import PydanticDecoder from the submodule |
| 34 | +from httpware import AsyncClient |
| 35 | +from httpware.decoders.pydantic import PydanticDecoder |
| 36 | + |
| 37 | +async with AsyncClient(decoder=PydanticDecoder()) as client: |
| 38 | + user = await client.get("/users/1", response_model=User) |
| 39 | +``` |
| 40 | + |
| 41 | +## What's next |
| 42 | + |
| 43 | +Epic 3 (resilience middleware — retry, timeout, bulkhead) and Epic 5 (observability) ship in subsequent releases. See `planning/engineering.md` §8. |
0 commit comments