diff options
| author | Brett Parson <brett@brett-parson.com> | 2026-08-21 13:55:37 -0500 |
|---|---|---|
| committer | Brett Parson <brett@brett-parson.com> | 2026-08-21 14:00:11 -0500 |
| commit | d039a5d62a9ac6ababae70d9d96422ca59f2b2d4 (patch) | |
| tree | f0db4750a571e8040a5da02cc7190079c0d62914 /docs/adr/0003-request-response-boundary.md | |
| parent | 0de77a6334cee1f6e15f7e0fd35602514560be33 (diff) | |
| download | miniroute-d039a5d62a9ac6ababae70d9d96422ca59f2b2d4.tar.gz miniroute-d039a5d62a9ac6ababae70d9d96422ca59f2b2d4.zip | |
Scaffold miniroute routing/middleware kernel
Diffstat (limited to 'docs/adr/0003-request-response-boundary.md')
| -rw-r--r-- | docs/adr/0003-request-response-boundary.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/adr/0003-request-response-boundary.md b/docs/adr/0003-request-response-boundary.md new file mode 100644 index 0000000..9129c0d --- /dev/null +++ b/docs/adr/0003-request-response-boundary.md @@ -0,0 +1,27 @@ +# ADR 0003: Thin HTTP Contracts + +- Status: Accepted +- Date: 2026-08-17 + +## Context + +The kernel needs request/response types, but applications already have their +own concrete HTTP objects (and their own security headers, session handling, +and parsing). + +## Decision + +The kernel defines `RequestInterface` and `ResponseInterface` with only the +surface routing needs (method, path, params) and middleware needs (headers). +Applications implement these interfaces on their own classes. + +Middleware and controllers operate on the interfaces, so application code that +needs app-specific features narrows to its concrete types. + +## Consequences + +- The kernel stays decoupled from any one app's HTTP layer. +- Applications must implement the two interfaces (usually a small change to + existing Request/Response classes). +- Middleware parameters use `RequestInterface`; concrete middleware may need + an `instanceof` narrowing to access app-specific request methods. |
