Skip to content

Commit

Permalink
Update openapi-aot.md (#34341)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

---------

Co-authored-by: Tom Dykstra <[email protected]>
  • Loading branch information
Rick-Anderson and tdykstra authored Dec 11, 2024
1 parent 9e42cc7 commit 9566cee
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions aspnetcore/release-notes/aspnetcore-9/includes/openapi-aot.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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();
Expand All @@ -37,5 +29,3 @@ Publish the app.
```console
dotnet publish
```

The app publishes using Native AOT without warnings.

0 comments on commit 9566cee

Please sign in to comment.