Repository navigation
[.NET] Consume TCGC LRO status metadata and operation ID (shared input model) - #12564
Closed
iscai-msft wants to merge 1 commit into
Closed
iscai-msft wants to merge 1 commit into
iscai-msft wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
iscai-msft
requested review from
Alan Zimmer (alzimmermsft),
Jorge Rangel (jorgerangel-msft),
Jose Arriaga Maldonado (joseharriaga) and
m-nash
as code owners
November 12, 2026 17:38
Member
Author
|
Closing as a duplicate of #12563. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The empty-segments regression test throws on a missing property before reaching segments validation, leaving the intended validation untested.
1 open issue
What changed in this PR
This PR carries TCGC long-running operation metadata through the shared C# emitter and input model, enabling the Azure generator to consume status values and operation IDs.
Changes:
- Preserves selected status properties, typed property paths, and ordered operation ID sources.
- Adds C# input types and JSON converters while retaining defaults when metadata is absent.
- Adds emitter serialization tests, converter tests, and an internal changelog entry.
| File | Description |
|---|---|
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TypeSpecInputConverterTests.cs |
Tests metadata deserialization and invalid operation IDs. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/TypeSpecSerialization.cs |
Registers the new converters. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/InputOperationLinkConverter.cs |
Deserializes operation links. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/InputLroStatusMetadataConverter.cs |
Deserializes selected status properties and paths. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/InputLroOperationIdMetadataConverter.cs |
Deserializes path-based and property-based operation IDs. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/InputLongRunningServiceMetadataConverter.cs |
Reads the new metadata collections and skips unknown fields. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/InputOperationLink.cs |
Represents an operation link’s location and property. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/InputLroStatusMetadata.cs |
Represents selected status values and typed paths. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/InputLroOperationIdPropertyMetadata.cs |
Represents property-based operation IDs. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/InputLroOperationIdPathMetadata.cs |
Represents operation IDs extracted using polling routes. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/InputLroOperationIdMetadata.cs |
Adds the shared operation ID metadata base type. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/InputLongRunningServiceMetadata.cs |
Exposes metadata collections with backward-compatible constructors. |
packages/http-client-csharp/emitter/test/Unit/operation-converter.test.ts |
Tests metadata preservation and serialized references. |
packages/http-client-csharp/emitter/src/type/input-service-method.ts |
Defines the emitter’s metadata shapes. |
packages/http-client-csharp/emitter/src/lib/type-converter.ts |
Exposes property conversion for metadata references. |
packages/http-client-csharp/emitter/src/lib/operation-converter.ts |
Maps TCGC metadata into the shared input model. |
.chronus/changes/dotnet-shared-lro-metadata-2026-11-12.md |
Records the shared-model enhancement. |
Review effort: Balanced
Comment on lines
+98
to
+105
| [TestCase("""{"kind":"property","propertySegments":[]}""")] | ||
| [TestCase("""{"kind":"path","path":"/jobs/{id}"}""")] | ||
| public void RejectsInvalidLongRunningOperationId(string json) | ||
| { | ||
| var options = new JsonSerializerOptions | ||
| { | ||
| Converters = { new InputLroOperationIdMetadataConverter() } | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Part of Azure/typespec-azure#5996
Consumes the TCGC
0.74.0LRO metadata in the shared@typespec/http-client-csharpemitter and input model:@lroStatusMetadata→SdkLroStatusMetadatapropertySegmentsonSdkLroStatusMetadata@lroOperationId→SdkLroServiceMetadata.operationId(orderedSdkLroOperationIdMetadatawithpropertySegments)Changes
statusMetadataandoperationIdon the LRO service metadata, with model properties emitted as input-type references.InputLroStatusMetadata,InputLroOperationIdMetadata(InputLroOperationIdPathMetadata/InputLroOperationIdPropertyMetadata), andInputOperationLink, plus JSON converters.InputLongRunningServiceMetadatagainsStatusMetadataandOperationId.The Azure generator PR in
Azure/azure-sdk-for-net(eng/packages/http-client-csharp) consumes this shared model to generate the poller accessors and carries the customization table.Tests
TypeSpecInputConverterTestscoverage for the new converters.