Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List resources with two different resources but same resource type #1911

Open
Tracked by #1850
pshao25 opened this issue Nov 26, 2024 · 1 comment
Open
Tracked by #1850

List resources with two different resources but same resource type #1911

pshao25 opened this issue Nov 26, 2024 · 1 comment
Assignees
Labels
design:needed A design request has been raised that needs a proposal lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library
Milestone

Comments

@pshao25
Copy link
Member

pshao25 commented Nov 26, 2024

An example:

There are two resources in Diagnostics (though they share the same model, but these two paths have different actions), this one and this one. Pay attention to the same resource type: Microsoft.Compute/locations/diagnostics. Let's call them AResource and BResource for now.

"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/diagnostics/diskInspection":
"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/diagnostics/spotPlacementRecommender":

They also have a list operation:

"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/diagnostics":

If there is only AResource, we will generate SDK like:

public static Pageable<AResource> GetResources(); 

If there is only BResource, we will generate SDK like:

public static Pageable<BResource> GetResources(); 

Now we have both AResource and BResource, then question is what is this list listing?

  1. From the route, we actually don't know which resource it is listing.
  2. From SDK perspective, we don't have a way to generate both of them if this list means both AResource and BResource.

To be more general:

When below conditions are satisfied, this issue comes up:

  1. Two paths, same resource type.
  2. Different actions on these two paths so seems these two paths cannot combine together.
  3. A list operation listing this resource type.
@pshao25
Copy link
Member Author

pshao25 commented Nov 29, 2024

A related issue Azure/autorest.csharp#2562

@markcowl markcowl added design:needed A design request has been raised that needs a proposal lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library labels Dec 2, 2024
@markcowl markcowl added this to the Backlog milestone Dec 2, 2024
@markcowl markcowl self-assigned this Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design:needed A design request has been raised that needs a proposal lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library
Projects
None yet
Development

No branches or pull requests

2 participants