Skip to content

Incorrect Subject Names When Generating Commands with *SkypeForBusiness* in their operationId  #795

@peombwa

Description

@peombwa

Operations that have *SkypeForBusiness* in their operation Ids are generated as commands with incorrect subject names. It looks like AutoREST.PowerShell truncates everything after *Skype in *SkypeForBusiness*. e.g.,
This operation with operationId: reports_getSkypeForBusinessActivityCounts:

  '/reports/microsoft.graph.getSkypeForBusinessActivityCounts(period=''{period}'')':
    get:
      tags:
        - reports.Functions
      summary: Invoke function getSkypeForBusinessActivityCounts
      operationId: reports_getSkypeForBusinessActivityCounts

ends up being generated as Get-MgReportSkype instead of the expected Get-MgReportSkypeForBusinessActivityCount.

Repro Steps:

  1. Generate PowerShell module using this sample OpenAPI document as AutoREST's input-file:
autorest --powershell --input-file:https://gist.githubusercontent.com/peombwa/3883d3bd7152f59c0bf5f53adfabd6f4/raw/d8cf9bba631e1ace66f4ee7e5f2def74fb333155/BrokenSkypeForBusiness.yml --clear-output-folder
  1. Inspect the generate cmdlets folder. You'll notice all cmdlets that call /reports/microsoft.graph.getSkypeForBusiness* are generated as Get-MgReportSkype.
    image

Environment

  • Tested with both autorest/powershell v2.1.401 and v3.0.402.

Related to microsoftgraph/msgraph-sdk-powershell#628.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions