Metadata-Version: 2.5
Name: openframe-protocol-http
Version: 0.5.0
Summary: OpenFrame Microservice Suite - HTTP/ASGI server binding for openframe.core.inbound handlers.
Project-URL: Homepage, https://github.com/Furious-Meteors/openframe-protocol
Project-URL: Documentation, https://furious-meteors.github.io/openframe-protocol/
Project-URL: Repository, https://github.com/Furious-Meteors/openframe-protocol
Project-URL: Changelog, https://github.com/Furious-Meteors/openframe-protocol/blob/production/.github/CHANGELOG.md
Project-URL: Bug Tracker, https://github.com/Furious-Meteors/openframe-protocol/issues
Author-email: Furious Meteors Engineering <engineering@furiousmeteors.dev>
Maintainer-email: Furious Meteors Engineering <engineering@furiousmeteors.dev>
License: MIT
Keywords: fastapi,hexagonal,http,microservice,openframe,protocol
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: openframe-core<4,>=3.2.1
Requires-Dist: openframe-protocol-base<1,>=0.1
Provides-Extra: client
Requires-Dist: httpx>=0.27; extra == 'client'
Provides-Extra: dev
Requires-Dist: fastapi>=0.110; extra == 'dev'
Requires-Dist: httpx>=0.27; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-mock>=3.14; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Provides-Extra: server
Requires-Dist: fastapi>=0.110; extra == 'server'
Description-Content-Type: text/markdown

# openframe-protocol-http

HTTP/ASGI server binding. Wires a `QueryHandler`/`CommandHandler`/`UseCase`
(`openframe.core.inbound`) to a FastAPI route through the shared error
mapper and `RequestContext` builder in `openframe-protocol-base`, instead
of each route hand-mapping `HTTPException`s itself.

Install the `[server]` extra for the FastAPI/ASGI dependencies —
`openframe-protocol-http[server]`.

## Wiring example

```python
from openframe.protocol.http import bind_query, bind_command, install_error_handlers

router = APIRouter(prefix="/items")

bind_query(
    router, "/{item_id}",
    handler_dep=get_get_item_handler,
    path_param=("item_id", str),
    response_model=Item,
    not_found_when=lambda item: item is None,
)

bind_command(
    router, "", method="POST",
    handler_dep=get_create_item_handler,
    body_model=Item,
    status_code=201,
    response_model=Item,
)

install_error_handlers(app)
```

## Status

Experimental, M1 of the project's own build plan — proves the inbound
handler contract survives a real transport before anything else
(HTTP client, gRPC, sessions) is attempted.
