docs(decoders): add a "write your own ResponseDecoder" guide#67
Merged
Conversation
Add docs/decoders.md, the Seam B extension-point guide that mirrors docs/middleware.md: the can_decode/decode protocol (no-raise obligation, auto-DecodeError wrapping), decoders=[...] list-order resolution and the MissingDecoderError pre-flight, a sync-for-both-clients callout, a runnable CSV worked example, and the "claim narrowly / two-pass is allowed" note. Closes deferred item G6 (custom-decoder guide) and wires the page into the mkdocs nav after Middleware. No source or public-API change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ship bookkeeping for PR #67: mark the change shipped (pr: 67, outcome filled), move the bundle from changes/active/ to changes/archive/, and flip its Index line from Active to Archived. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
docs/decoders.md, the Seam B extension-point guide — the decoder counterpart todocs/middleware.md. Closes deferred item G6 (custom-ResponseDecoderguide).Contents
The page mirrors the structure of the middleware guide:
can_decode/decode, thecan_decodeno-raise obligation (it runs outside theDecodeErrorwrap), and auto-DecodeErrorwrapping ofdecodefailures.decoders=[...]order as preference, the pydantic-firstNonedefault, and theMissingDecoderErrorpre-flight vsDecodeErrordistinction.ClientandAsyncClient, unlike middleware's two flavors.text/csv→list[<dataclass>], stdlib-only and single-pass, chosen because both built-ins are JSON so it best teaches that the seam is raw-bytes-in / typed-object-out.Also
mkdocs.yml—Decodersnav entry afterMiddleware.planning/deferred.md— G6 removed (closed).2026-06-15.01-custom-decoder-guide.No source or public-API change.
Verification
ResponseDecoderprotocol —can_decodeacceptslist[Sale]and rejectslist/list[int]/Sale/dict;decoderound-trips a CSV body.mkdocs build --strict— clean (links resolve, nav builds).just lint— clean.🤖 Generated with Claude Code