Skip to content

Walkthrough: one orders app from request to response, as a sample that CI builds and runs #116

Closed

Description

@CaffeinatedCoder

Problem

Each guide covers one boundary:

  • binding and rejected input in docs/aspnet-core.md;
  • the wire form in docs/json.md;
  • columns and the SQL a query becomes in docs/ef-core.md;
  • PATCH bodies in docs/merge-patches.md;
  • logs in docs/logging-and-secrets.md.

None shows one value object crossing all of them in a single application, and none says where it changes on the way through. Its text guard cleans it in Create. It's written as the wrapped type's JSON and stored as a plain column, and .Value in a query becomes that column in SQL. A rejected value gets an answer that never quotes the input, and a masked value is masked in a log line.

The smoke test's host consumer puts EF Core and the OpenAPI document together, but it's a check, not something a reader can follow. A walkthrough written as prose alone would go stale, because nothing would run it end to end.

This is TypeKit's counterpart of CaffeinatedCoder/CodoMetis.ValueRanges#418.

Change

  • A sample application that runs. A minimal API orders service, built on the Generators, EF Core, ASP.NET Core and Serilog packages:
    • value objects: an id over Guid, an e-mail address validated by Create with a text guard, a quantity, and an order status as a closed set;
    • bound from the route, the query string and a JSON body, with a rejected value answered as problem details;
    • handlers that return a Result as the HTTP response, and an Option for a missing order as a 404;
    • storage with EF Core on SQLite in memory, and a query that filters on .Value;
    • a PATCH endpoint taking a Patch<T>;
    • logging through the Serilog policy, with the e-mail address masked;
    • the OpenAPI document.
  • CI runs it and checks what it says. A fifth consumer, walkthrough, in tools/ConsumerSmokeTest, asserts on the HTTP responses, the SQL EF Core logs, the log lines and the OpenAPI document, never on the exit code alone. It builds against the packed packages outside the repository, as a reader's project would, so Directory.Build.props doesn't apply. It runs on SQLite in memory like host, so it needs no container and runs on every OS leg. Native AOT stays with the aot consumer.
  • docs/walkthrough.md, in the plain-docs voice, quotes excerpts from the sample and links to its full source. Each step says what changes at that boundary, or that nothing does.
  • The excerpts are the sample's code. Today ReadmeSampleTests finds a page's regions only in test/CodoMetis.TypeKit.Samples. Extend it so that this page's regions (// sample: walkthrough/{name} ... // end sample) are found in the walkthrough consumer's sources, under the same exactly-one-region rule. The outputs the page states in comments (a response body, the SQL, a log line) are read from the page by the smoke test's assertions, so the page and the program can't drift apart. As everywhere else, a changed output is fixed in the comment, never in the test.
  • Claims. The page's promises go into test/oracles/claims.json. If heldBy can't name the smoke consumer, an integration test holds them.

Done when

  • The sample builds and runs in CI on every PR and fails when an answer it prints changes.
  • docs/walkthrough.md is linked from the README's "Documentation" table and from docs/value-objects.md, and from the docs site's navigation once that exists (Docs site: publish docs/ and the READMEs to GitHub Pages from main, with API pages #115).
  • Seeded and caught: an excerpt edited in the page without the sample's source fails ReadmeSampleTests, and an answer changed in the sample without the page's comment fails the smoke test.

Activity

  1. added this to the 2.3.0 milestone on Oct 29, 2026
  2. added
    documentationImprovements or additions to documentation
    package/coreAffects CodoMetis.TypeKit
    package/generatorsAffects CodoMetis.TypeKit.Generators
    package/efcoreAffects CodoMetis.TypeKit.EntityFrameworkCore
    package/aspnetcoreAffects CodoMetis.TypeKit.AspNetCore
    package/serilogAffects CodoMetis.TypeKit.Serilog
    area/value-objectsValue-object contracts and what the aspects generate for them
    on Oct 29, 2026
  3. added
    area/jsonSystem.Text.Json wire forms, values and dictionary keys
    area/toolingThe repository's tools: prober, verdict, guard, docs-query, smoke test
    on Oct 29, 2026
  4. CaffeinatedCoder commented on Oct 29, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Done in #141, merged into release/2.3.0 (2501ddc): docs/walkthrough.md and the smoke test's walkthrough consumer, with the page in the docs site's menu (#138).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/jsonSystem.Text.Json wire forms, values and dictionary keysarea/option-resultOption, Result and their extensionsarea/toolingThe repository's tools: prober, verdict, guard, docs-query, smoke testarea/value-objectsValue-object contracts and what the aspects generate for themdocumentationImprovements or additions to documentationpackage/aspnetcoreAffects CodoMetis.TypeKit.AspNetCorepackage/coreAffects CodoMetis.TypeKitpackage/efcoreAffects CodoMetis.TypeKit.EntityFrameworkCorepackage/generatorsAffects CodoMetis.TypeKit.Generatorspackage/serilogAffects CodoMetis.TypeKit.Serilog

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions