Apply suggestions from PR review

Co-authored-by: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com>
pull/33773/head
Mike Kistler 2024-10-05 13:55:48 -05:00 committed by GitHub
parent b4c1d2788c
commit 8c6a20e7bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 5 deletions

View File

@ -328,14 +328,13 @@ If an endpoint can return different response types in different scenarios, you c
#### Excluding endpoints from the generated document
By default, all endpoints that are defined in an app are documented in the generated OpenAPI file,
but endpoints can be excluded from the document using attributes or extension methods.
By default, all endpoints that are defined in an app are documented in the generated OpenAPI file, but endpoints can be excluded from the document using attributes or extension methods.
The mechanism for specifying an endpoint should be excluded depends on the type of app being developed.
The mechanism for specifying an endpoint that should be excluded depends on the type of app being developed.
##### [Minimal APIs](#tab/minimal-apis)
Minimal APIs support two strategies for excluding a given endpoint from the OpenAPI document, using:
Minimal APIs support two strategies for excluding a given endpoint from the OpenAPI document:
* <xref:Microsoft.AspNetCore.Http.OpenApiRouteHandlerBuilderExtensions.ExcludeFromDescription%2A>
* <xref:Microsoft.AspNetCore.Routing.ExcludeFromDescriptionAttribute>
@ -355,7 +354,7 @@ app.MapGet("/attributes",
In controller-based apps, the <xref:Microsoft.AspNetCore.Mvc.ApiExplorerSettingsAttribute> attribute can be used to exclude an endpoint from the OpenAPI document.
The following example demonstrates how to exclude an endpoint from the generated OpenAPI document.
The following example demonstrates how to exclude an endpoint from the generated OpenAPI document:
```csharp
[HttpGet("/private")]