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

As an HTTP API developer using Open API to enable integration, my APIs include an opinionated convention of ensuring operationId attributes are created for each Web API controller method #27591

Closed
Tracked by #27889
bradygaster opened this issue Oct 23, 2020 · 11 comments
Labels
affected-most This issue impacts most of the customers area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels enhancement This issue represents an ask for new feature or an enhancement to an existing one Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. severity-minor This label is used by an internal tool
Milestone

Comments

@bradygaster
Copy link
Member

One of the more important concepts in the OpenAPI Specification is the concept of operationId. Each API method’s descriptive metadata can be augmented with operationId to provide code generations and consumers with a cleaner API for consumers to use.

When we speak of a consumer, we’re speaking of a variety of code-generation and endpoint-parsing tools that make use of the OpenAPI spec to generate code or UI. AutoRest, swagger-codegen, NSwag, and SwaggerHub - all products used throughout the API community to either generate client SDK code to call an API or to provide documentation about an API – they all prioritize operationId, as do our partners in the Power Platform, when using Open API files or API Management-hosted APIs to provide citizen developers easy ways of dialing APIs into their Power Apps.

Our Controller templates don't explicitly name each method. As such, code generators and consumers need to "guess" what to name the generated code methods. This results in odd situations where client SDKs have methods like get, get1, get2, and so on.

Existing controller method syntax:

[HttpGet]
public IEnumerable<WeatherForecast> Get()

Desired syntax:

[HttpGet(Name = nameof(Get))]
public IEnumerable<WeatherForecast> Get()
@bradygaster bradygaster changed the title As an HTTP API developer using Open API to enable code-generated clients, my APIs include an opinionated to ensure operationId attributes are created for each Web API controller method As an HTTP API developer using Open API to enable integration, my APIs include an opinionated to ensure operationId attributes are created for each Web API controller method Oct 23, 2020
@bradygaster bradygaster changed the title As an HTTP API developer using Open API to enable integration, my APIs include an opinionated to ensure operationId attributes are created for each Web API controller method As an HTTP API developer using Open API to enable integration, my APIs include an opinionated convention of ensuring operationId attributes are created for each Web API controller method Oct 23, 2020
@carlossanlop
Copy link
Member

Should this issue be in the ASP.NET repo?

@bradygaster
Copy link
Member Author

adding @mkArtakMSFT and @pranavkm to see if it should be.

@carlossanlop carlossanlop transferred this issue from dotnet/core Nov 6, 2020
@pranavkm pranavkm added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Nov 6, 2020
@pranavkm
Copy link
Contributor

pranavkm commented Nov 7, 2020

Thanks @bradygaster. Do you see a system where we require users to specify this name if they have Swagger / ApiExplorer enabled in their apps? Or is this more of a guidance that recommends people name their operations?

@captainsafia captainsafia added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Nov 9, 2020
@captainsafia captainsafia added this to the Next sprint planning milestone Nov 9, 2020
@ghost
Copy link

ghost commented Nov 9, 2020

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@pranavkm pranavkm added affected-most This issue impacts most of the customers severity-minor This label is used by an internal tool labels Nov 12, 2020
@bradygaster
Copy link
Member Author

@mkArtakMSFT @javiercn - definitely need this to help developers on the right operationId path.

@pranavkm pranavkm added area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels and removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels Aug 26, 2021
@pranavkm pranavkm modified the milestones: 6.0-rc1, 6.0-rc2 Aug 28, 2021
@adityamandaleeka adityamandaleeka modified the milestones: 6.0-rc2, Backlog Sep 13, 2021
@ghost
Copy link

ghost commented Sep 13, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@adityamandaleeka
Copy link
Member

Triage: moving to backlog

@rafikiassumani-msft
Copy link
Contributor

@bradygaster can we close this issue? OperationId work was part of .NET6. Any further improvement ?

@rafikiassumani-msft rafikiassumani-msft added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Dec 28, 2021
@ghost
Copy link

ghost commented Dec 28, 2021

Hi @bradygaster. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@ghost
Copy link

ghost commented Jan 3, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

@bradygaster
Copy link
Member Author

Yes this can be closed. I'll close it. :)

@ghost ghost locked as resolved and limited conversation to collaborators Feb 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affected-most This issue impacts most of the customers area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels enhancement This issue represents an ask for new feature or an enhancement to an existing one Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. severity-minor This label is used by an internal tool
Projects
None yet
Development

No branches or pull requests

7 participants