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 <tdykstra@microsoft.com>

---------

Co-authored-by: Tom Dykstra <tdykstra@microsoft.com>
pull/34343/head
Rick Anderson 2024-12-11 13:49:06 -10:00 committed by GitHub
parent 9e42cc7bee
commit 9566ceeec4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 12 deletions

View File

@ -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.