Skip to content

docs: add a request-binder usage sample with a living catalog - #187

Merged
Reefact merged 1 commit into
mainfrom
claude/request-binder-usage-examples-yld421
Jul 18, 2026
Merged

docs: add a request-binder usage sample with a living catalog#187
Reefact merged 1 commit into
mainfrom
claude/request-binder-usage-examples-yld421

Conversation

@Reefact

@Reefact Reefact commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

Add a dedicated FirstClassErrors.RequestBinder.Usage sample that gives a complete, runnable picture of the request binder on a hotel-booking boundary, with its own generated, snapshot-tested error catalog. This meets the intent of #154 (the binder exercised in living, generated documentation) with a sibling sample rather than by folding binder specifics into the core FirstClassErrors.Usage catalog — see the rationale on the issue.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Analyzer / diagnostic change
  • Tests
  • Documentation
  • Build / CI / tooling

Changes

  • Add FirstClassErrors.RequestBinder.Usage (net8.0;net10.0), referencing the binder + core and dogfooding the analyzers:
    • BookingBinder — a full request bound end-to-end: required/optional, raw and converted scalars, the value-type overloads, a nested object, lists of simple and of complex elements, the New and validating Create terminals, and collect-all aggregation.
    • BinderShowcase — the remaining overloads and options: required lists, optional sections, a custom IArgumentNameProvider (snake_case), custom structural codes with symbolic branching, and the non-nullable value-type guard.
    • BookingEndpoint — a framework-agnostic call site rejoining the Outcome pipeline.
    • Six value objects (four class; NightCount/RoomNumber are struct, a deliberate consumer-side demonstration of the value-type overloads, documented in-code — the library's own value objects stay classes per CLAUDE.md) and three envelope errors, each fully documented and localized (en, fr, es, de, sv).
  • Add FirstClassErrors.RequestBinder.Usage.UnitTests asserting the collect-all order, envelope codes, and argument paths.
  • Add a snapshot test class in FirstClassErrors.GenDoc.UnitTests that extracts and renders the sample's catalog (JSON / Markdown / HTML, single + split, localized ×4), giving the binder its own generated, snapshot-tested catalog.
  • Register both projects in FirstClassErrors.sln; add a "Runnable examples" pointer to the English and French request-binder guides.

Testing

  • dotnet build FirstClassErrors.sln
  • dotnet test FirstClassErrors.sln
  • Analyzer tests pass (FirstClassErrors.Analyzers.UnitTests)

Full solution builds warning-free on net8.0 and net10.0; the whole suite is green (1028 tests, including 14 new behavioural tests and 14 new snapshot tests). The existing FirstClassErrors.Usage snapshots are unchanged.

Documentation

  • Public API / error documentation updated
  • README / doc/ updated
  • French translation (doc/handwritten/for-users/README.fr.md) updated if user-facing behavior changed
  • No documentation change required

The request-binder guide gains a "Runnable examples" section in both the English (RequestBinder.en.md) and French (RequestBinder.fr.md) versions. Every sample error is documented and localized in five languages.

Architecture decisions

  • No architectural decision in this pull request
  • New decision recorded — ADR drafted as Proposed: ADR-____
  • Supersedes an existing ADR — successor proposed, status not flipped: ADR-____
  • ⚠️ Conflicts with an existing ADR — flagged for the maintainer: ADR-____

The sample illustrates decisions already recorded (ADR-0007, 0008, 0012, 0016, 0017) without changing, superseding, or contradicting any. Note: the sample is not wired into the CI living-catalog / release gate (errors-baseline.json, gendoc-docs.yml --assemblies) — a deliberate scope boundary; its catalog is exercised by unit-test snapshots only.

Related issues

Closes #154


🤖 Generated with Claude Code


Generated by Claude Code

Add FirstClassErrors.RequestBinder.Usage, a dedicated sample giving a
complete, runnable picture of the request binder on a hotel-booking boundary:

- BookingBinder binds a full request end-to-end: required/optional, raw and
  converted scalars, the value-type overloads, a nested object, lists of
  simple and of complex elements, the New and validating Create terminals,
  and collect-all aggregation.
- BinderShowcase rounds out the remaining overloads and options: required
  lists, optional sections, a custom IArgumentNameProvider, custom structural
  codes, and the non-nullable value-type guard.
- BookingEndpoint is a framework-agnostic call site rejoining the Outcome
  pipeline.
- Every sample error is fully documented and localized (en, fr, es, de, sv).

The sample has its own generated, snapshot-tested catalog in
FirstClassErrors.GenDoc.UnitTests, and companion unit tests assert the
collect-all order, envelope codes, and argument paths. This meets the intent
of the issue (the binder exercised in living, generated documentation) with a
sibling sample rather than by folding binder specifics into the core
FirstClassErrors.Usage catalog.

Refs: #154

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014QZMxXBeE7iXCLkaZshuFR
@Reefact
Reefact force-pushed the claude/request-binder-usage-examples-yld421 branch from 55fba57 to 1704813 Compare July 18, 2026 22:04
@Reefact
Reefact merged commit 127e2df into main Jul 18, 2026
13 checks passed
@Reefact
Reefact deleted the claude/request-binder-usage-examples-yld421 branch July 18, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Binder: add a request-binder example to FirstClassErrors.Usage

2 participants