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

[Feature Request] Standardize operationIds to ensure uniqueness #361

Open
peombwa opened this issue Mar 24, 2023 · 3 comments
Open

[Feature Request] Standardize operationIds to ensure uniqueness #361

peombwa opened this issue Mar 24, 2023 · 3 comments
Assignees
Labels
priority:p3 Nice to have. Customer impact is very minimal type:enhancement Enhancement request targeting an existing experience.

Comments

@peombwa
Copy link
Contributor

peombwa commented Mar 24, 2023

We should consider standardizing the naming convention of operationIds to what we currently have in DevX API (PowerShell style) - https://github.com/microsoftgraph/microsoft-graph-devx-api/blob/dev/OpenAPIService/PowershellFormatter.cs? For example:

  • Remove hash suffix values from operationIds for function all paths.
  • Add '_' to separate verb (action) in an operationId. This typically the last . or second from last . for OData cast paths.
  • PUT operations should have Set as the verb in an operationId {xxx}_Set{yyy}.

In PowerShell, we use operationIds to form command names.

As part of this exercise, we should add validation to ensure operationIds are unique for a given document.

Edit: This is a continuation of #338 (comment).

@irvinesunday
Copy link
Collaborator

I like this:

As part of this exercise, we should add validation to ensure operationIds are unique for a given document.

@peombwa I have a few questions on this:

  1. Are there other clients (outside of AutoREST dependent clients) that are already using the current format that would be impacted by this change?
  2. The clients referred to in your comment, are they using this library directly?

@irvinesunday irvinesunday added this to the OData: Backlog milestone May 3, 2023
@peombwa
Copy link
Contributor Author

peombwa commented May 22, 2023

  1. Are there other clients (outside of AutoREST dependent clients) that are already using the current format that would be impacted by this change?

Not that I’m aware of. All Microsoft Graph OpenAPI-based SDKs use paths and operation names to construct request builders/command names except for PowerShell, which uses AutoREST. AutoREST uses operationIds to construct command names; uniqueness is key. If a breaking change is a concern, I think it’s best to assume that there is probably a tool out there that takes a dependency on the current OperationId naming convention.

  1. The clients referred to in your comment, are they using this library directly?

This is based on a customer comment in the metadata repo at microsoftgraph/msgraph-metadata#289:

I was attempting to use an existing openapi parser (Azure Autorest) to build a client for the graph yaml, and it generates ~40 errors due to duplicate operationId values.

Based on the customer issue, they are using the OpenAPI YAML file in the metadata repo that’s generated using this library.

@irvinesunday
Copy link
Collaborator

If a breaking change is a concern, I think it’s best to assume that there is probably a tool out there that takes a dependency on the current OperationId naming convention.

@peombwa based on this concern, can we put a hold on this request?

@irvinesunday irvinesunday added the priority:p3 Nice to have. Customer impact is very minimal label May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p3 Nice to have. Customer impact is very minimal type:enhancement Enhancement request targeting an existing experience.
Projects
None yet
Development

No branches or pull requests

2 participants