Azure / autorest.powershell

AutoRest PowerShell Generator
MIT License
112 stars 83 forks source link

Incorrect Singularization of Certain Words #956

Open peombwa opened 2 years ago

peombwa commented 2 years ago
The following words are incorrectly singularized: Word OperationId CommandName
Sms users.authentication.methods_enableSmsSignIn Enable-UserAuthenticationMethodSmSign
iOS and Statuses deviceManagement_ListIosUpdateStatuses Get-DeviceManagementIoUpdateStatuses
Windows deviceManagement_GetWindowsAutopilotSettings Get-DeviceManagementWindowAutopilotSetting

Possible Solutions

dingmeng-xue commented 2 years ago

@dolauli , let's discuss design here.

dolauli commented 2 years ago

Configuration design

we may add configurations as below to specify singular form for a noun.

WordsOfSpecialSingularization:
  - Pluralization: Sms
    Singularization: Sms
  - Pluralization: Windows
    Singularization: Window

Code change

Need to update following codes to apply the configurations above https://github.com/Azure/autorest.powershell/blob/9eb9fada924562e1566028d4a926c3f5d01c7f40/powershell/plugins/plugin-create-inline-properties.ts#L17-L24 https://github.com/Azure/autorest.powershell/blob/9eb9fada924562e1566028d4a926c3f5d01c7f40/powershell/plugins/create-commands-v2.ts#L36-L40