Azure / autorest.powershell

AutoRest PowerShell Generator
MIT License
111 stars 76 forks source link

Get-AzElasticTagRule has 2 ParameterSets with same Parameters #1189

Closed vidai-msft closed 1 year ago

vidai-msft commented 1 year ago

Using v4 to generate Get-AzElasticTagRule has same Parameters with different ParameterSets like below (Common parameters removed) Cmdlet: Get-AzElasticTagRule -> ParameterSet: Get -> Parameter: MonitorName -> Parameter: ResourceGroupName -> Parameter: SubscriptionId -> ParameterSet: ListViaIdentityMonitor -> Parameter: MonitorInputObject -> ParameterSet: GetViaIdentityMonitor -> Parameter: MonitorInputObject

The swagger file is https://github.com/Azure/azure-rest-api-specs/blob/73d8ea03558929411b9f2e6be533e63409a2252c/specification/elastic/resource-manager/Microsoft.Elastic/stable/2023-06-01/elastic.json

dolauli commented 1 year ago

Just found the root cause of the issue. The parameter RuleSetName specific to one of the two parameter sets is hidden by following directive.

  - where:
      verb: Get|New
      subject: TagRule
      parameter-name: RuleSetName
    hide: true
    set:
      default:
        script: '"default"'

And in this case, you will need to add a directive to remove the parameter set as below.

image