Azure / autorest.csharp

Extension for AutoRest (https://github.com/Azure/autorest) that generates C# code
MIT License
142 stars 166 forks source link

Cannot find the proper candidate when the scope resources have same resource type #2560

Closed Yao725 closed 1 year ago

Yao725 commented 2 years ago

In GuestConfiguration, we have these three resources:

/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{name}

They extend from different resource but have the same resource type, aka Microsoft.GuestConfiguration/guestConfigurationAssignments. In such case, the generator will find more than one candidate for the list method and the generation will fail.

Yao725 commented 1 year ago

Fixed in https://github.com/Azure/autorest.csharp/pull/2633