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

Add examples to AddOpenApi extension method/overloads #58808

Merged
merged 8 commits into from
Nov 7, 2024

Conversation

mikekistler
Copy link
Contributor

Add examples to AddOpenApi extension method/overloads

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Adds examples to the xmldoc for the AddOpenApi extension methods/overloads.

Description

Added an example to the xmldoc of each method showing the most common usage of this extension method -- to add OpenAPI services to the service collection of WebApplicationBuilder.

@mikekistler mikekistler requested review from captainsafia and a team as code owners November 5, 2024 21:45
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Nov 5, 2024
Copy link
Member

@captainsafia captainsafia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build is having trouble resolving the WebApplicationBuilder reference.

We'll need to add a reference to the Microsoft.AspNetCore.DefaultBuilder project to the *.csproj for this library then add any necessary usings.

@@ -19,6 +19,14 @@ public static class OpenApiServiceCollectionExtensions
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> to register services onto.</param>
/// <param name="documentName">The name of the OpenAPI document associated with registered services.</param>
/// <example>
/// This method is commonly used to add OpenAPI services to the service collection of a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and elsewhere?

Suggested change
/// This method is commonly used to add OpenAPI services to the service collection of a
/// This method is commonly used to add OpenAPI services to the <see cref="IServiceCollection" /> of a

@gfoidl gfoidl added feature-openapi area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc and removed area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels labels Nov 6, 2024
@mikekistler mikekistler merged commit 97c6f0d into main Nov 7, 2024
27 checks passed
@mikekistler mikekistler deleted the mdk/addopenapi-examples branch November 7, 2024 23:33
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview1 milestone Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc feature-openapi
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants