Skip to content

net11.0: a union over value objects, in a woven project, keeps its JSON and OpenAPI schema (Metalama 2027) #272

Open

Description

@CaffeinatedCoder

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

  1. JSON (from net11.0: Option/Result refusal and value-object JSON under System.Text.Json's union support #213). union Id(OrderId, int) and union 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).
  2. 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 $ref in the anyOf must 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

  1. added this to the 2.5.0 milestone on Oct 31, 2026
  2. added
    testsAdds or changes tests only (tests, probes, harnesses); no library code
    package/aspnetcoreAffects CodoMetis.TypeKit.AspNetCore
    area/value-objectsValue-object contracts and what the aspects generate for them
    area/jsonSystem.Text.Json wire forms, values and dictionary keys
    on Oct 31, 2026
  3. modified the milestones: 2.5.0, 2.4.0 on Oct 31, 2026
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/value-objectsValue-object contracts and what the aspects generate for thempackage/aspnetcoreAffects CodoMetis.TypeKit.AspNetCoretestsAdds or changes tests only (tests, probes, harnesses); no library code

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions