Skip to content

Releases: MrLoh/openapi-httpx

v0.1.2

16 Apr 23:14

Choose a tag to compare

Changes

  • Support datamodel-code-generator 0.55+ — upstream removed the datamodel_code_generator.model.pydantic submodule and renamed CustomRootType to RootModel in 0.55. We now import from pydantic_v2 with a fallback, so the package works across >=0.35.0,<1.0. Dependency range widened accordingly.

Full Changelog: v0.1.1...v0.1.2

v0.1.1

16 Apr 22:42

Choose a tag to compare

Changes

  • Documentation site — added a MkDocs-based docs site published via GitHub Pages, with usage, client reference, and API reference pages. Includes a poetry docs task for local preview.
  • Explicit public API — added __all__ = ["Config", "PythonVersion", "generate"] to openapi_httpx/__init__.py so the public surface is unambiguous to type checkers and re-exporters.

Full Changelog: v0.1.0...v0.1.1

v0.1.0

16 Apr 20:12

Choose a tag to compare

First release. openapi-httpx generates a typed httpx.Client (or AsyncClient) subclass from an OpenAPI 3.x spec. Path, query params, request body, and response type are all checked as a single unit per operation — no separate request/response model classes to keep in sync.

pip install openapi-httpx
openapi-httpx --input openapi.yaml --output client.py

Why this shape

The generated client is an httpx.Client subclass with one @overload per operation, keyed on the path literal:

client.GET("/user/{id}", params={"id": "123"})   # -> User
client.POST("/user", json={"name": "Ada"})        # -> User

You keep the full httpx.Client API (timeouts, event hooks, transports, auth) and gain per-endpoint types. No wrapper object, no new API to learn beyond httpx itself.

What's in 0.1.0

  • Sync and async clients (--async-client)
  • TypedDicts for params, bodies, and responses
  • Multipart form data with automatic file/field splitting
  • Optional closed TypedDicts (PEP 728) via --use-closed-typed-dict
  • Python 3.11 – 3.14

Caveats worth knowing

  • Path parameters go in params, not f-strings — interpolating into the path breaks overload resolution
  • Responses are returned already parsed (json by default, or text / None for raw bytes), and raise_for_status() is called automatically
  • Built on datamodel-code-generator, currently pinned <0.54