From 9566ceeec43989d7deabadaecc8a3b2f235920fc Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:49:06 -1000 Subject: [PATCH] Update openapi-aot.md (#34341) * Update openapi-aot.md Fixes #34340 * Update openapi-aot.md * Update openapi-aot.md * Update aspnetcore/release-notes/aspnetcore-9/includes/openapi-aot.md * Update aspnetcore/release-notes/aspnetcore-9/includes/openapi-aot.md * Update aspnetcore/release-notes/aspnetcore-9/includes/openapi-aot.md * Update aspnetcore/release-notes/aspnetcore-9/includes/openapi-aot.md Co-authored-by: Tom Dykstra --------- Co-authored-by: Tom Dykstra --- .../aspnetcore-9/includes/openapi-aot.md | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/aspnetcore/release-notes/aspnetcore-9/includes/openapi-aot.md b/aspnetcore/release-notes/aspnetcore-9/includes/openapi-aot.md index 45b425787267..ef54881f8757 100644 --- a/aspnetcore/release-notes/aspnetcore-9/includes/openapi-aot.md +++ b/aspnetcore/release-notes/aspnetcore-9/includes/openapi-aot.md @@ -1,8 +1,6 @@ ### Microsoft.AspNetCore.OpenApi supports trimming and Native AOT -The new built-in OpenAPI support in ASP.NET Core now also supports trimming and Native AOT. - -### Get started +OpenAPI in ASP.NET Core supports trimming and native AOT. The following steps create and publish an OpenAPI app with trimming and native AOT: Create a new ASP.NET Core Web API (Native AOT) project. @@ -16,13 +14,7 @@ Add the Microsoft.AspNetCore.OpenAPI package. dotnet add package Microsoft.AspNetCore.OpenApi --prerelease ``` -For this preview, you also need to add the latest Microsoft.OpenAPI package to avoid trimming warnings. - -```console -dotnet add package Microsoft.OpenApi -``` - -Update *Program.cs* to enable generating OpenAPI documents. +Update `Program.cs` to enable generating OpenAPI documents. ```diff + builder.Services.AddOpenApi(); @@ -37,5 +29,3 @@ Publish the app. ```console dotnet publish ``` - -The app publishes using Native AOT without warnings.