You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 35dcf6e
Browse filesBrowse the repository at this point in the historyBrowse files
fix(csharp): serialize a TPH collection by each row's runtime type
GET /<base> returns List<Base>, and System.Text.Json serializes a collection by
its DECLARED element type — so a discriminated-union list answered 200 with rows
quietly missing half their columns. Nothing errored.
A single-object read was unaffected, because ASP.NET falls back to the runtime
type when it differs from the declared one. That asymmetry is why this survived:
GET /parties/{id} showed a Broker's bondNumber while GET /parties did not, so
every by-id assertion passed and the shape looked right wherever anyone looked
at one row.
The base class now carries a [JsonDerivedType(typeof(<Sub>))] per concrete
subtype — declarative, so it also covers a base-typed collection nested inside
another response, which fixing only the list handler would not. No type
discriminator is configured, so NO $type key is emitted: the model already
carries @Discriminator as an ordinary property, and a second C#-only key would
be an addition to a cross-port wire contract. Deserializing into the base is not
something the generated routes do — an abstract base has no create/update
handler, and each subtype's handler deserializes that subtype directly.
Non-TPH entities are byte-identical; the committed integration fixture moves by
exactly the three attribute lines on Auth.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015NrWUxA6euwvnFcwKxcK6A
0 commit comments