You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move MapOpenApi() Inside the IsDevelopment() block for consistency wi… (#34541)
* Move MapOpenApi() Inside the IsDevelopment() block for consistency with templates and other docs
The default template with .NET 9 has MapOpenApi() inside the IsDevelopment block. Many examples on MS Learn also have it inside due to limit information exposure.
Move inside to minimize potential for confusion to devs.
* Conditionally map all calls to OpenApi in development environment
* Combined MapOpenAPI and MapScalar in same env condition
Line 501, moved app.MapOpenAPI() to same environment condition block for app.MapScalarApiReference()
* Updated code highlight
---------
Co-authored-by: Wade Pickett <wpickett@microsoft.com>
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/openapi/aspnetcore-openapi.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn how to generate and customize OpenAPI documents in an ASP.NET
5
5
ms.author: safia
6
6
monikerRange: '>= aspnetcore-6.0'
7
7
ms.custom: mvc
8
-
ms.date: 12/11/2024
8
+
ms.date: 01/23/2025
9
9
uid: fundamentals/openapi/aspnetcore-openapi
10
10
---
11
11
# Generate OpenAPI documents
@@ -48,7 +48,7 @@ The following code:
48
48
* Adds OpenAPI services using the <xref:Microsoft.Extensions.DependencyInjection.OpenApiServiceCollectionExtensions.AddOpenApi%2A> extension method on the app builder's service collection.
49
49
* Maps an endpoint for viewing the OpenAPI document in JSON format with the <xref:Microsoft.AspNetCore.Builder.OpenApiEndpointRouteBuilderExtensions.MapOpenApi%2A> extension method on the app.
0 commit comments