microsoftgraph / msgraph-sdk-powershell

Powershell SDK for Microsoft Graph
https://www.powershellgallery.com/packages/Microsoft.Graph
Other
691 stars 165 forks source link

Duplicated operaionId #2843

Open dinowang opened 2 months ago

dinowang commented 2 months ago

Describe the bug

Multiple Open API spec has duplicated operaionId

For example: https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/openApiDocs/v1.0/Users.yml

  '/users/{user-id}/photo':
    get:
      tags:
        - users.profilePhoto
      summary: Get photo from users
      description: The user's profile photo. Read-only.
      operationId: user_GetPhoto
      parameters:
        - name: user-id
  '/users/{user-id}/photos/{profilePhoto-id}':
    get:
      tags:
        - users.profilePhoto
      summary: Get photos from users
      description: The collection of the user's profile photos in different sizes. Read-only.
      operationId: user_GetPhoto
      parameters:
        - name: user-id

When user import Open API spec into product/service. Like Azure API Management will cause conflict

image

Expected behavior

OperationId should unique.

How to reproduce

  1. Create Azure API Management service
  2. Click API, create API from defination
  3. Paste Open API spec URL, fill the form then press Create
image

SDK Version

v1.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ``` ```

Configuration

No response

Other information

No response

timayabi2020 commented 1 month ago

@dinowang thanks a lot for identifying this issue. Indeed, this is a violation based on Open Api spec description. https://spec.openapis.org/oas/v3.0.3. I am transferring this issue to the team responsible so that they work on it.

irvinesunday commented 3 weeks ago

From the OpenAPI spec. the two paths have different operation ids. See below:

image _usersGetPhoto - link

image _usersGetPhotos - link