.NET 11 Brings C# 15 Union Types and OpenAPI 3.2 to ASP.NET Core
🚀 Key Takeaways
- First-class union type handling: ASP.NET Core integrates C# 15 union types directly into JSON request and response pipelines across Minimal APIs and MVC.
- Next-generation API contracts: Built-in document generation now targets OpenAPI 3.2 by default, automatically projecting union variants and modern HTTP patterns into client specifications.
- Enhanced endpoint execution: Minimal APIs receive non-blocking asynchronous validation, built-in message localization, and explicit middleware short-circuiting.
- Persistent real-time connections: SignalR adds proactive authentication refresh mechanics to sustain long-lived sessions alongside client-side invocation cancellation.
- Hardened server infrastructure: Kestrel integrates native Zstandard compression and resilient request parsing to maximize throughput under heavy workloads.
The release of .NET 11 delivers a major evolutionary milestone for distributed web services and cloud-native APIs.
By pairing direct framework support for C# 15 union types with default OpenAPI 3.2 schema generation, ASP.NET Core bridges the longstanding gap between expressive domain modeling and precise contract communication.
These architectural refinements directly address the real-world friction developers encounter when designing resilient REST and event-driven interfaces.
Teams no longer need intricate custom converters or third-party wrappers to cleanly serialize polymorphic data structures or describe complex endpoints like Server-Sent Events.
Coupled with runtime-level enhancements across Minimal APIs, SignalR authentication, and Kestrel throughput, this release enables engineering teams to build high-performance services with less defensive code and significantly greater type safety.
By pairing direct framework support for C# 15 union types with default OpenAPI 3.2 schema generation, ASP.NET Core bridges the longstanding gap between expressive domain modeling and precise contract communication.
These architectural refinements directly address the real-world friction developers encounter when designing resilient REST and event-driven interfaces.
Teams no longer need intricate custom converters or third-party wrappers to cleanly serialize polymorphic data structures or describe complex endpoints like Server-Sent Events.
Coupled with runtime-level enhancements across Minimal APIs, SignalR authentication, and Kestrel throughput, this release enables engineering teams to build high-performance services with less defensive code and significantly greater type safety.

1. Integrating C# 15 Union Types into ASP.NET Core JSON Pipelines
As ASP.NET Core now supports union types and OpenAPI 3.2 by default, modernizing type safety across endpoint contracts has become a foundational pillar of the framework in .NET 11.This section examines how C# 15 union types are incorporated directly into JSON handling across both Minimal APIs and MVC controllers.
System.Text.Json Serialization and Custom Classifier Setup
ASP.NET Core in .NET 11 introduces native support for C# 15 union types, allowing developers to model complex, multi-case data contracts cleanly.To process these structures over the wire, the framework leverages System.Text.Json directly to handle both serialization and deserialization.
This integration works uniformly across Minimal APIs and MVC controller actions, ensuring consistent output and input handling regardless of the web framework style chosen.
A common structural challenge arises when multiple union cases share the exact same JSON shape.
To resolve ambiguity in these scenarios, developers can configure a classifier for deserialization.
The classifier provides the necessary discrimination logic, allowing System.Text.Json to inspect the incoming payload and correctly instantiate the intended union case even when the property names and values do not inherently distinguish one variant from another.
JSON Body Scope and Parameter Binding Constraints
While the introduction of C# 15 union types enhances payload modeling, ASP.NET Core establishes an explicit architectural boundary regarding where union types can be utilized.Union type support is strictly limited to JSON bodies.
Consequently, endpoints can accept union types in incoming JSON request bodies and return them via JSON response bodies across Minimal APIs and MVC.
However, parameter binding outside of JSON payloads is not supported.
Specifically, route parameters, query strings, headers, and form values cannot bind to union types.
Developers designing HTTP APIs must account for these binding boundaries when structuring endpoint signatures and data ingestion routes.
| HTTP Binding Target / Pipeline Location | C# 15 Union Type Support Status | Supported Framework Surfaces |
|---|---|---|
| JSON Request Bodies | Supported | Minimal APIs and MVC |
| JSON Response Bodies | Supported | Minimal APIs and MVC |
| Route Parameters | Not Supported | None (Strictly Limited to JSON Bodies) |
| Query Strings | Not Supported | None (Strictly Limited to JSON Bodies) |
| Request Headers | Not Supported | None (Strictly Limited to JSON Bodies) |
| Form Values | Not Supported | None (Strictly Limited to JSON Bodies) |

2. OpenAPI 3.2 Default Document Generation and Schema Specifications
ASP.NET Core has transitioned its built-in API metadata engine to support union types and OpenAPI 3.2 by default.This integration directly aligns metadata generation with modern protocol patterns and rich type structures across HTTP services.
Schema Representation: anyOf Structures, SSE Streams, and HTTP QUERY
Generated OpenAPI documents in ASP.NET Core now default to version 3.2.This upgrade enables precise structural schema modeling for advanced type definitions and streaming endpoints.
Generated OpenAPI documents represent C# union types using anyOf schemas composed of their case types.
Endpoints streaming Server-Sent Events (SSE) are documented with distinct schemas for each event payload, ensuring multi-event real-time streams are fully typed in client contracts.
OpenAPI document generation now describes endpoints that utilize the HTTP QUERY method, accommodating complex read operations with request bodies.
Additionally, APIs marked with the [Obsolete] attribute are automatically emitted as deprecated in the generated OpenAPI documentation.
Breaking Changes in Microsoft.OpenApi 3.3.1 and Downstream Compatibility
The framework depends on Microsoft.OpenApi version 3.3.1 for OpenAPI 3.2 document generation.Updating to Microsoft.OpenApi 3.3.1 is classified as a breaking change in the ASP.NET Core release notes.
Because downstream generators, parsers, and developer tooling ecosystems may not yet support the 3.2 specification, developers can explicitly configure an earlier OpenAPI version if downstream tooling is incompatible with 3.2.
| Specification / Capability | OpenAPI 3.2 Implementation Details | Compatibility and Tooling Status |
|---|---|---|
| Default Specification Version | Generated OpenAPI documents default to version 3.2. | Developers can explicitly configure an earlier OpenAPI version if downstream tooling is incompatible with 3.2. |
| Underlying Engine Dependency | The framework depends on Microsoft.OpenApi version 3.3.1 for document generation. | Updating to Microsoft.OpenApi 3.3.1 is classified as a breaking change. |
| C# Union Type Schemas | Represented using anyOf schemas composed of their individual case types. | Generated natively under the OpenAPI 3.2 default. |
| Server-Sent Events (SSE) | Streaming endpoints are documented with distinct schemas for each event payload. | Supported natively in OpenAPI 3.2 document output. |
| HTTP QUERY Protocol | Document generation describes endpoints that utilize the HTTP QUERY method. | Documented as part of the OpenAPI 3.2 specification set. |
| Deprecation Mapping | APIs marked with the [Obsolete] attribute are emitted as deprecated. | Directly mapped to schema deprecation flags in generated documentation. |

3. Minimal API Execution: Asynchronous Validation and Middleware Short-Circuiting
Alongside core architectural upgrades such as native union types and out-of-the-box OpenAPI 3.2 support, ASP.NET Core introduces substantial performance and runtime refinements directly into the Minimal API pipeline.These execution improvements target both request validation overhead and middleware routing efficiency, giving high-throughput services tighter control over resource consumption.
Non-Blocking Asynchronous Validation and Native Localization
Validating incoming payloads often requires deeper verification steps, such as checking identity stores or querying external microservices.Minimal API validation now natively supports asynchronous validators, preventing thread blocking during database lookups or remote calls.
Because the validator execution model is non-blocking, threads are returned to the runtime pool while waiting for I/O operations to complete, directly bolstering server throughput under heavy request volume.
In addition to asynchronous validation handling, the framework natively localizes validation messages and display names.
Application teams no longer need to implement custom parsing layers to deliver culturally formatted error descriptors, as the framework automatically binds localized strings for validation failures across supported locales.
Bypassing Middleware Overhead with [ShortCircuit]
Standard request pipelines route every incoming call through an ordered chain of middleware components, including routing, authentication, authorization, and custom filters.To optimize performance for specialized or high-frequency endpoints, endpoints can bypass the remaining middleware pipeline using the new [ShortCircuit] attribute.
Applying [ShortCircuit] halts downstream middleware invocation immediately after endpoint matching, allowing the framework to serve immediate responses without incurring the processing penalties of subsequent pipeline stages.

4. SignalR Connection Resilience: Authentication Refresh and Circuit Synchronization
Alongside core platform modernizations such as native union types and OpenAPI 3.2 support by default, ASP.NET Core advances its real-time communication tier.Real-time web applications frequently encounter connection termination issues when short-lived access tokens expire during active streaming sessions.
SignalR addresses this challenge by introducing authentication refresh, which enables long-lived connections to persist smoothly after access token expiration.
Per-Hub Token Refresh Across .NET and TypeScript Clients
Authentication refresh operates with granular control on the server side, where it is enabled on a per-hub basis.This per-hub configuration ensures that security-sensitive hubs can enforce refreshed credentials without requiring application-wide blanket rules.
Client runtimes interact with this authentication refresh mechanism according to their respective client environments.
The .NET SignalR client handles token updates seamlessly by refreshing tokens automatically by default.
Conversely, the SignalR TypeScript client supports manual configuration, providing frontend developers the flexibility to wire in custom token retrieval flows.
| Target / Layer | Feature | Operational Behavior |
|---|---|---|
| SignalR Hub (Server) | Authentication Refresh Activation | Enabled per hub on the server to keep long-lived connections alive beyond token expiration. |
| .NET SignalR Client | Token Renewal | Refreshes tokens automatically by default. |
| TypeScript SignalR Client | Token Renewal | Supports manual configuration for refreshing tokens. |
| Blazor Interactive Server | Identity Synchronization | Refreshed identities are passed automatically over active circuits. |
Client-Side Cancellation and Blazor Interactive Server Identity Propagation
In addition to token persistence, real-time method execution gains fine-grained operational control through client-side cancellation.SignalR hub invocations now support client-side cancellation directly, enabling calling clients to abort in-flight hub requests when operations are no longer needed.
For unified application architectures, this real-time pipeline connects directly to Blazor Interactive Server components.
When an authentication refresh occurs on an active SignalR connection, refreshed identities are passed automatically to Blazor Interactive Server components over active circuits.
This automated circuit synchronization ensures stateful Blazor components reflect current security credentials without triggering teardowns or connection drops.

5. Kestrel and Core Infrastructure: Parser Resilience, Zstandard, and Runtime Async
While the headline features of the ASP.NET Core release cycle focus on high-level API design—namely default OpenAPI 3.2 generation and native union type responses—the underlying host infrastructure delivers critical performance hardening.As Microsoft confirmed, .NET 11 is a Standard Term Support (STS) release supported for two years, pairing these endpoint-level contracts with substantial lower-level server throughput and pipeline modernizations.
Kestrel HTTP/1.1 Parser Optimization and Default Zstandard Compression
In high-throughput edge environments, malformed or malicious HTTP/1.1 traffic historically imposed severe overhead due to the instantiation and unwinding of internal parser exceptions.Kestrel's HTTP/1.1 parser stops throwing exceptions on malformed requests to improve throughput.
By replacing exception-driven failure paths with non-allocating control flow, eliminating parser exceptions on malformed requests increases Kestrel throughput by 20 to 40 percent under heavy invalid traffic.
This parser resilience ensures that invalid client connections consume minimal execution time, safeguarding application capacity for legitimate payloads.
Alongside parser hardening, data transfer mechanisms receive an efficiency upgrade through expanded algorithmic support.
Zstandard compression is added for response compression and request decompression, enabled by default.
This provides modern end-to-end compression out of the box, reducing network transit overhead for outbound API responses while handling compressed inbound client payloads without manual decompression plumbing.
TLS Listener Modernization and Shared Framework Deprecations
Host-level security and pipeline management have been restructured to eliminate outdated interception patterns.Kestrel introduces the UseTlsClientHelloListener extension to provide a structured, robust approach for inspecting incoming TLS handshakes.
Consequently, Kestrel's TlsClientHelloBytesCallback option is marked obsolete in favor of UseTlsClientHelloListener.
This shift modernizes how server endpoints handle SNI routing and early security inspection.
Framework-level consolidation also phases out legacy tooling integrations.
The Microsoft.AspNetCore.Grpc.Swagger package is deprecated as API metadata generation shifts toward native and modern OpenAPI toolchains.
Underpinning all of these updates, ASP.NET Core shared framework libraries are compiled internally with Runtime Async, optimizing runtime execution across core framework assemblies.
| Component / Feature | Update Details | Performance or Architectural Impact |
|---|---|---|
| HTTP/1.1 Malformed Traffic Handling | Kestrel's HTTP/1.1 parser stops throwing exceptions on malformed requests | Increases Kestrel throughput by 20 to 40 percent under heavy invalid traffic |
| Zstandard Compression | Added for response compression and request decompression, enabled by default | Provides modern bidirectional payload compression out of the box |
| TLS Client Hello Inspection | Introduced UseTlsClientHelloListener extension | Replaces obsolete TlsClientHelloBytesCallback option |
| Microsoft.AspNetCore.Grpc.Swagger | Deprecated package | Phases out legacy gRPC Swagger integration |
| Internal Framework Compilation | Compiled internally with Runtime Async | Modernizes internal ASP.NET Core shared framework library execution |
| Release Lifecycle | Standard Term Support (STS) | Supported for two years |

Generative AI may have assisted with research or drafting for this article. Topic selection, fact-checking, final wording, and publication remain the responsibility of DragonStone74. AI use disclosure


