Repository navigation
Description
Goal
Show that a union whose cases include a value object keeps TypeKit's JSON and OpenAPI guarantees, in a project woven by Metalama 2027.0. These checks moved here from #213 (check 2) and #214 (check 2) on 2026-10-31.
Why it waits for the Metalama move
Each check declares a union in a project that holds value objects, so that project is woven by the Generators package. On Metalama 2026.1, which 2.3.x stays on, that doesn't compile: Metalama's compiler runs C# 14 on net11.0 too, so declaring a union gives CS0106, CS8803 and CS1001, and matching on one gives CS8652 (decision 120, measured on SDK 11 RC1; #170 repeats it on RC3). A 2.3.x consumer reaches these shapes only through a union declared in an assembly without the Generators package. 2.4.0 moves to Metalama 2027.0 (#173, decision 129, 2026-10-31; it was 2.5.0 until then), which runs C# 15 on net11.0, and every consumer can write them.
Checks
- JSON (from net11.0: Option/Result refusal and value-object JSON under System.Text.Json's union support #213).
union Id(OrderId, int)andunion Key(Sku, Quantity), with a string-wrapping and a number-wrapping value object. The union's JSON must equal the JSON of the same union over the wrapped types, and reading it must pick the same case, under reflection and under a source-generated context. To measure: whether System.Text.Json's token-type classifier sees a value object's custom converter as its wrapped type's token kind, or as unknown. If unknown, decide whether TypeKit can say what token it writes, and file that as an enhancement. A failed read of a value-object case quotes no input (UnreadableInputTests). - OpenAPI (from net11.0: OpenAPI transformers under OpenAPI 3.2, server-sent events and union return types #214). A minimal API endpoint returns a union whose cases include a value object and a closed set. Each case's
$refin theanyOfmust resolve to the wrapped type's or the set's schema, with its description, not to an object schema, under OpenAPI 3.2 and 3.1.
Done when
The checks run in the net11.0 test run on Metalama 2027.0, each shown caught by a seeded defect (verify-the-guard). Each disagreement is an issue of its own, or a candidate in test/oracles/candidates.json with its issue. Blocked by #173.
Activity