Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated operaionId #2843

Open
dinowang opened this issue Jul 10, 2024 · 2 comments
Open

Duplicated operaionId #2843

dinowang opened this issue Jul 10, 2024 · 2 comments
Labels
dependency:OpenAPI.NET Awaiting fix from core dependency project module type:bug A broken experience

Comments

@dinowang
Copy link

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 ```
</details>


### Configuration

_No response_

### Other information

_No response_
@dinowang dinowang added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jul 10, 2024
@timayabi2020
Copy link
Contributor

@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.

@timayabi2020 timayabi2020 added dependency:OpenAPI.NET Awaiting fix from core dependency project module and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Jul 25, 2024
@irvinesunday
Copy link

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

image
users_GetPhoto - link

image
users_GetPhotos - link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency:OpenAPI.NET Awaiting fix from core dependency project module type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

3 participants