Repository navigation
[http-client-csharp] Add discriminated union extends support - #12481
JoshLove01 merged 20 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Make envelope union bases abstract and emit context-specific union methods in their model serialization files. Cover shared-base wire formats and restore the Spector skip comment. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Resolved the conflicts with The dependency blocker is resolved for this branch by pinning compiler All six original inline review comments have replies. --generated by Copilot |
Preserve union serialization while adopting the upstream lifecycle revert and dynamic-model decorator migration. Align prerelease compiler and TCGC dependencies, override stale compiler peer constraints, and regenerate client fixtures. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
commit: |
|
No changes needing a change description found. |
…eneration Keep the union-extends Spector client non-stubbed under the default generation command so CI regeneration matches the committed runtime-test fixture. Preserve stub generation for other Spector scenarios. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Fixed the regeneration failures in e303b24. The default generation command was replacing the executable union-extends Spector client with API-only stubs, which caused the generated-file drift on both platforms. That scenario now retains its executable client during default regeneration; other scenarios still generate stubs. Verified default regeneration leaves both the union-extends fixture and an unrelated stub fixture unchanged, and the five union Spector scenarios still pass. --generated by Copilot |
Generate and commit the missing union-extends debugger profile using ScmCodeModelGenerator, matching the executable Spector fixture and eliminating remaining CI regeneration drift. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Fixed the remaining regeneration drift in 2ad40bb. The latest run confirms the generated clients now match; the only outstanding difference was the missing union-extends debugger launch profile. Added that generated profile and made it select --generated by Copilot |
There was a problem hiding this comment.
🟡 Changes recommended
Union handling generates uncompilable SDK code for BinaryData customizations and leaves supported envelope variants internal, preventing consumers from constructing them or accessing variant-specific properties.
2 open issues
1 file not reviewed
packages/http-client-csharp/package-lock.json: Generated file
What changed in this PR
Adds C# support for tagged JSON unions with an explicit model base and nominally inherited variants, addressing #12478. The implementation preserves union-specific envelopes while keeping direct payload-model serialization unwrapped.
Changes:
- Updates dependencies and carries supported union metadata from the emitter into the generator.
- Adds contextual envelope serialization and inherited-discriminator constructor handling.
- Adds sample hierarchies, serialization baselines, Spector coverage, and generation-script integration.
| File | Description |
|---|---|
| packages/http-client-csharp/package.json | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/Type.Union.Discriminated.Extends.slnx | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/Type.Union.Discriminated.Extends.NuGet.targets | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/tests/Type.Union.Discriminated.Extends.Tests.csproj | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Type.Union.Discriminated.Extends.csproj | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/schema/ConfigurationSchema.json | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Recursive.RestClient.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/UnknownRecursivePet.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/UnknownInjectedPet.Serialization.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/UnknownInjectedPet.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/UnknownExplicitPet.Serialization.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/UnknownExplicitPet.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/UnknownEnumPet.Serialization.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/UnknownEnumPet.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/UnknownCustomPet.Serialization.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/UnknownCustomPet.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/RecursivePet.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/RecursiveDog.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/RecursiveCat.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/PetKind.Serialization.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/PetKind.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/Mammal.Serialization.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/Mammal.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/InjectedPet.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/InjectedDog.Serialization.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/InjectedDog.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/InjectedCat.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/ExplicitPet.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/ExplicitDog.Serialization.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/ExplicitDog.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/ExplicitCat.Serialization.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/ExplicitCat.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/EnumPet.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/EnumDog.Serialization.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/EnumDog.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/EnumCat.Serialization.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/EnumCat.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/CustomPet.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/CustomDog.Serialization.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/CustomDog.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/CustomCat.Serialization.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/CustomCat.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Models/_TypeUnionDiscriminatedExtendsContext.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/Utf8JsonBinaryContent.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/SerializationFormat.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/PipelineRequestHeadersExtensions.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/Optional.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/ErrorResult.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/CodeGenTypeAttribute.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/CodeGenSuppressAttribute.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/CodeGenSerializationAttribute.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/CodeGenMemberAttribute.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/ClientPipelineExtensions.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/ChangeTrackingList.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/ChangeTrackingDictionary.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/CancellationTokenExtensions.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/BinaryContentHelper.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/Internal/Argument.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/InjectedDiscriminatorOperations.RestClient.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/InjectedDiscriminator.RestClient.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/InjectedDiscriminator.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/ExtendsClientSettings.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/ExtendsClientOptions.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/ExtendsClient.RestClient.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/ExtendsClient.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/ExplicitDiscriminatorOperations.RestClient.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/ExplicitDiscriminator.RestClient.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/ExplicitDiscriminator.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/EnumDiscriminatorOperations.RestClient.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/EnumDiscriminator.RestClient.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/EnumDiscriminator.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/CustomDiscriminatorOperations.RestClient.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/CustomDiscriminator.RestClient.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/src/Generated/CustomDiscriminator.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/Configuration.json | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/extends/client.tsp | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/response-replacement/tspCodeModel.json | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector.Tests/TestProjects.Spector.Tests.csproj | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/_Type/Union/Discriminated/Extends/UnionExtendsTests.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspconfig.yaml | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UnionExtends.RestClient.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecModelFactory.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Models/UnionPetContainer.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Models/UnionPet.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Models/UnionDog.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Models/UnionCat.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Models/SampleTypeSpecContext.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/TypeFactory.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelProvider.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Properties/launchSettings.json | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/PropertyWireInformation.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/InputUnionTypeConverter.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/InputNamespaceConverter.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/InputUnionType.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/InputNamespace.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/DiscriminatedUnionSerializationTests/WritesContextualEnvelopeSerialization(type,data).cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/DiscriminatedUnionSerializationTests/WritesContextualEnvelopeSerialization(kind,value).cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/DiscriminatorTests.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmModelProvider.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs | Updated as part of this pull request. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs | Updated as part of this pull request. |
| packages/http-client-csharp/eng/scripts/Generation.psm1 | Updated as part of this pull request. |
| packages/http-client-csharp/eng/scripts/Generate.ps1 | Updated as part of this pull request. |
| packages/http-client-csharp/emitter/test/Unit/utils/test-util.ts | Updated as part of this pull request. |
| packages/http-client-csharp/emitter/src/type/input-type.ts | Updated as part of this pull request. |
| packages/http-client-csharp/emitter/src/type/code-model.ts | Updated as part of this pull request. |
| packages/http-client-csharp/emitter/src/lib/type-converter.ts | Updated as part of this pull request. |
| packages/http-client-csharp/emitter/src/lib/client-model-builder.ts | Updated as part of this pull request. |
Review effort: Balanced
…iants Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Critical generator defects can produce uncompilable SDKs and broken union handling through duplicate signatures, unsuppressed experimental references, abstract payload deserialization, and incorrect JSONL serialization and parsing.
5 open issues
Suppress experimental payload diagnostics in generated union helpers · New Avoid duplicate union-helper signatures when names collide with model deseriali… · New Preserve concrete payload deserialization for nested union hierarchies · New Keep object-enveloped unions compatible with JSONL serialization · New Keep envelope union variants publicly reachable
1 resolved since last review
1 file not reviewed
packages/http-client-csharp/package-lock.json: Generated file
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Critical issues in alternate-type mappings, inherited union helpers, and XML deserialization can prevent generated SDK compilation, while JSONL byte serialization can emit invalid JSON.
9 open issues
Exclude externally mapped unions from envelope handling · New Keep externally mapped bases on the fallback path · New Preserve base64 serialization for byte-valued JSONL items · New Avoid inherited union helper name collisions · New Handle XML deserialization for abstract envelope bases · New Keep object-enveloped unions compatible with JSONL serialization Preserve concrete payload deserialization for nested union hierarchies Suppress experimental payload diagnostics in generated union helpers Keep envelope union variants publicly reachable
1 resolved since last review
1 file not reviewed
packages/http-client-csharp/package-lock.json: Generated file
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Fixed in a08bc7e: helper-name allocation now reserves properties, fields, and methods throughout the resolved hand-written CLR ancestry, not only input/generated models. Added a multi-level ancestor regression and a generated sample that compiles with protected conflicting members.
Fixed in the same commit: non-JSON union responses now return raw --generated by Copilot |
There was a problem hiding this comment.
🔵 Needs a closer look
Shared constructor generation and external-base serialization changes affect existing hierarchies beyond union-extends, warranting human compatibility review and a full .NET regression run beyond the reported scoped validation.
No open issues 🎉
1 file not reviewed
packages/http-client-csharp/package-lock.json: Generated file
Review effort: Balanced
|
[P2] Preserve raw-data handling for non-JSON union requests ScmMethodProviderCollection.cs:406-411 An operation accepting 🤖 Generated by Jorge's Copilot |
|
[P2] Allow unrelated models to be omitted during helper-name allocation DiscriminatedUnionSerialization.cs:142-160 The new throwing 🤖 Generated by Jorge's Copilot |
Map non-JSON union request bodies to BinaryData and keep envelope serialization JSON-only. Tolerate omitted models during helper-name candidate scans while retaining checked resolution for required participants. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Fixed in 020c998: non-JSON union request bodies now expose
Fixed in the same commit: ancestor/descendant candidate scans tolerate null factory results, and omitted providers are skipped when collecting member names. Required union base and variant resolution still has explicit checks. Added a plugin-style regression that omits an unrelated input model. --generated by Copilot |
Preserve union event handling alongside upstream deprecation metadata support. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Take main's stable TCGC 0.74.0 / TypeSpec 1.18.0 pins and lockfile. Re-enable the discriminated/extends Spector scenario that main marked as pending, since this PR implements it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Jorge Rangel (jorgerangel-msft)
left a comment
There was a problem hiding this comment.
LGTM
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Summary
@discriminatedunions with an explicit model base and nominally inherited model variants, exposing the declared base in generated C# APIs.Sample-TypeSpechierarchy, positive/negative unit tests, serialization baselines, and Spector coverage for explicit, injected, custom, enum, and recursive inline discriminators.Scope and dependencies
This covers the tagged JSON section of the .NET design.
@events/SSE support is not included. Unions that do not meet the supported explicit-base and nominal-inheritance requirements retain their existing representation.Uses the compatible prereleases containing the required metadata/projection: TCGC
0.74.0-dev.9and Azure Core0.74.0-dev.4. HTTP spec dependencies are updated to include the integration scenarios.Validation
npm run buildand generatedSample-TypeSpeccompilation passed.Validation after the constructor compatibility fix used the scoped suites above; a second full .NET test run was not performed.
Relates to #12478.