Skip to content

In in SignIn is truncated from command names #955

@peombwa

Description

@peombwa

Given an operationId of reports_ListApplicationSignInDetailedSummary, AutoREST.PowerShell currently generates a command name of Get-ReportApplicationSign instead of Get-ReportApplicationSignInDetailedSummary. It looks like AutoREST.PowerShell treats the In in SignIn as a preposition thus truncating everything after the preposition in:

function splitOnAnyPreposition(parts: Array<string>) {
for (const p of ['with', 'at', 'by', 'for', 'in', 'of']) {
const result = splitOnPreposition(p, parts);
if (result && result[0].length > 0) {
// we found it, let's give it back.
return result;
}
}
return undefined;
}
.

Possible Solutions

  • Exclude compound words such as SignIn and SignOut from being broken into two distinct words.
  • Provide a configuration that customers can use to bypass the truncation of prepositions if they desire. Certain APIs use prepositions in their paths to communicate meaning. e.g., https://graph.microsoft.com/v1.0/users/{id}/memberOf.

Workaround

We can use rename directive to target the affected command variants and rename them to the proper name as a workaround. While this works well when targeting a handful of commands, it doesn't scale when the directive needs to be applied to hundreds of APIs/commands since we need to know ahead of time which command variants are affected.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions