-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Description
C# is expected to add language-level discriminated unions, and we should prepare to support them end-to-end once the feature lands.
Impacted frameworks/tech: Minimal APIs, Blazor, SignalR, MVC, JSON Patch, OpenAPI
Key Areas to Address
-
Serialization handling
Ensure discriminated unions work correctly as both input and result types. This includes model binding, JSON serialization, and any polymorphic scenarios. -
Polymorphism support
Verify that discriminated unions interoperate smoothly with existing polymorphic type handling in the framework and serializers. -
OpenAPI integration
Update OpenAPI generation so that discriminated union types are accurately represented in generated specs. -
Source-generated & non-source-generated parity
Confirm consistent behavior across both source-generated Minimal APIs and the non-source-generated RDF.
Goals
Achieve seamless usage of discriminated unions across the API surface so developers can use them naturally in Minimal APIs without workarounds.