Skip to content

Add Support for Union Extends #12478

Open

Description

Cross language issue: Azure/typespec-azure#5703
Design gist: https://gist.github.com/JoshLove-msft/73a1bd727a1667bd4851ad5651d668e4

This issue covers adding generation support for union extends as described in link. As part of this issue, we should enable and use the spector tests cases as a test of the implementation.

Activity

  1. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor

    🎯 Issue Triage

    Add C# client generation support for inherited unions (union extends) according to the linked cross-language design, validated by the existing union Spector scenarios.

    Category: Feature Request
    Area: emitter:client:csharp

    🔍 Analysis

    The affected component is @typespec/http-client-csharp. The compiler-side extends base type for unions was implemented separately in #2737; this request is specifically for the C# client emitter to represent those semantics in generated code. Related issues such as #7923 (adopting discriminated-union Spector scenarios) and #4202 (general heterogeneous-union generation) overlap in topic but do not describe the same request.

    The implementation should follow the linked cross-language design and use the cases under packages/http-specs/specs/type/union as conformance coverage.

    📝 Suggested next steps
    • Map inherited union metadata into the C# emitter's generated type model.
    • Enable the applicable type/union Spector scenarios for the C# client emitter.
    • Add focused generator tests for inheritance, serialization, and deserialization behavior.

    Generated by Agentic Triage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

emitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharpfeatureNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions