Fix tuple resource list handling in mgmt generator#59363
Merged
ArcturusZhang merged 4 commits intoMay 25, 2026
Conversation
Classify array-returning tuple resource list operations as resource lists and emit all matching collection GetAll overloads so Compute extension image list operations remain available. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Azure Management (TypeSpec) emitter and C# mgmt generator to more reliably classify array-returning GET operations as resource list methods, including tuple-resource intermediate collection paths, and to generate multiple GetAll overloads when several list operations map to the same collection.
Changes:
- Adjust list-target resource matching to treat an operation path as a prefix of a resource’s instance path (better handling of tuple-resource intermediate collection paths).
- Update the C#
ResourceCollectionClientProviderto keep and emit multiple list (GetAll/GetAllAsync) methods, with ordering to select a canonical list method for contextual operation mapping. - Add/adjust emitter tests and update resource detection documentation to reflect the new matching rules.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/storage/Azure.ResourceManager.Storage/tsp-location.yaml | Normalizes additionalDirectories formatting in the TypeSpec location config. |
| eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Providers/ResourceCollectionClientProvider.cs | Tracks multiple list methods, selects a canonical list method for context, and emits all GetAll overloads. |
| eng/packages/http-client-csharp-mgmt/emitter/test/resource-detection.test.ts | Adds coverage for tuple-resource intermediate list paths and updates TrafficManager custom resource expectations to include list. |
| eng/packages/http-client-csharp-mgmt/emitter/src/resource-detection.ts | Changes list-target matching from exact collection-path match to prefix match against the resource instance path. |
| eng/packages/http-client-csharp-mgmt/docs/resource-detection.md | Updates the documented list-matching algorithm to the new prefix-first behavior with scope-level fallback. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
live1206
approved these changes
May 25, 2026
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.
Summary
Validation