Skip to content

Commit eb49a16

Browse files
docs(http): remove unimplemented deserializeStream handler property (#641)
* docs(http): remove unimplemented deserializeStream handler property The content-type handler interface table documented a `deserializeStream(stream)` property that Harper does not implement. The `ContentTypeHandler` interface in the core repo declares only `serialize`, `serializeStream`, `deserialize`, and `q`. Removes the `deserializeStream` row and drops the now-dangling "Used when `deserializeStream` is absent." clause from the `deserialize(buffer)` description. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs(http): clarify serializeStream return type and granularity The Handler Interface table typed `serializeStream` as returning a WHATWG `ReadableStream`. Verified against harper origin/main: every built-in handler returns a Node.js `Readable` (`streamAsJSON` -> `JSONStream extends Readable`, `Readable.from(...)`, `EncoderStream`, `toCsvStream`), and the call site in `server/serverHelpers/contentTypes.ts` pipes the return value through `createBrotliCompress()` and hands it to the HTTP layer as the response body. Also record the granularity: `serializeStream` is invoked once per response with the entire iterable, and only when the response body is an iterable or async iterable. Per-chunk serialization is `serialize`, which the streaming handlers call for each message. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 0841ba6 commit eb49a16

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

reference/http/api.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,12 @@ contentTypes.set('text/xml', {
434434
435435
### Handler Interface
436436
437-
| Property | Type | Description |
438-
| --------------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
439-
| `serialize(data)` | `(any) => Buffer \| Uint8Array \| string` | Serialize data for a response |
440-
| `serializeStream(data)` | `(any) => ReadableStream` | Serialize as a stream (for async iterables or large data) |
441-
| `deserialize(buffer)` | `(Buffer \| string) => any` | Deserialize an incoming request body. Used when `deserializeStream` is absent. String for `text/*` types, Buffer for binary types. |
442-
| `deserializeStream(stream)` | `(ReadableStream) => any` | Deserialize an incoming request stream |
443-
| `q` | number (0–1) | Quality indicator for content negotiation. Defaults to `1`. |
437+
| Property | Type | Description |
438+
| ----------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
439+
| `serialize(data)` | `(any) => Buffer \| Uint8Array \| string` | Serialize data for a response |
440+
| `serializeStream(data)` | `(any) => Readable` | Serialize a streaming response body. Called once per response with the whole iterable (not once per chunk), and only when the response body is an iterable or async iterable. Returns a Node.js [`Readable`](https://nodejs.org/api/stream.html#class-streamreadable). |
441+
| `deserialize(buffer)` | `(Buffer \| string) => any` | Deserialize an incoming request body. String for `text/*` types, Buffer for binary types. |
442+
| `q` | number (0–1) | Quality indicator for content negotiation. Defaults to `1`. |
444443
445444
---
446445

0 commit comments

Comments
 (0)