Skip to content

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 a team and captainsafia as code owners November 5, 2024 21:45
@ghost ghost added the old-area-web-frameworks-do-not-use *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.

/// <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 old-area-web-frameworks-do-not-use *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
captainsafia added a commit that referenced this pull request Feb 11, 2025
* Add examples to AddOpenApi extension method/overloads
* Commit suggestions from PR review

Co-authored-by: Safia Abdalla <[email protected]>
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.

4 participants