-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Description
Description
@tdykstra please review
Also applies to content health.
Some duplication but related content is scattered between the two docs
Refactor OpenAPI support in minimal API apps
OpenAPI support in minimal API apps
Describe endpoints
OpenAPI supports providing summaries and descriptions of routes that are registered in an app. Minimal APIs support two strategies for setting these properties on a given endpoint, using the following extension methods and attributes:
Summaries: WithSummary
Descriptions: WithDescription
Summaries: EndpointSummaryAttribute
Descriptions: EndpointDescriptionAttribute
Get started with Microsoft.AspNetCore.OpenApi
Customize OpenAPI endpoints with endpoint metadata
The following list shows the endpoint metadata that is used to customize the generated OpenAPI document:
Summaries from IEndpointSummaryMetadata
Descriptions from IEndpointDescriptionMetadata
Request body from IAcceptsMetadata
Response information from IProducesResponseTypeMetadata
Operation IDs from IEndpointNameMetadata
OpenAPI tags from ITagsMetadata
To learn more about customizing the generated OpenAPI document by modifying endpoint metadata, see How to use OpenAPI in Minimal API apps.
Page URL
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/openapi?view=aspnetcore-9.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/minimal-apis/openapi.md
Document ID
b18acd86-50e3-2316-27be-27156651e5a8