Skip to content

Commit 3050b58

Browse files
authored
Do not show unnecessary steps for creating AOT-compatible OpenAPI application when running in .NET 10 (#34757)
* Only show steps for adding packages to the "webapiaot" template if running .NET 9 or lower I also removed the --prerelease flag from the package, no reason to add a prerelease version; AOT works fine without prerelease * Change the ways monikers are layed out
1 parent b8ad4b5 commit 3050b58

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

aspnetcore/fundamentals/openapi/aspnetcore-openapi.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,14 @@ Create a new ASP.NET Core Web API (Native AOT) project.
259259
dotnet new webapiaot
260260
```
261261

262+
:::moniker-end
263+
264+
:::moniker range="= aspnetcore-9.0"
265+
262266
Add the Microsoft.AspNetCore.OpenAPI package.
263267

264268
```console
265-
dotnet add package Microsoft.AspNetCore.OpenApi --prerelease
269+
dotnet add package Microsoft.AspNetCore.OpenApi
266270
```
267271

268272
Update `Program.cs` to enable generating OpenAPI documents.
@@ -275,12 +279,12 @@ var app = builder.Build();
275279
+ app.MapOpenApi();
276280
```
277281

282+
:::moniker-end
283+
278284
Publish the app.
279285

280286
```console
281287
dotnet publish
282288
```
283289

284-
:::moniker-end
285-
286290
[!INCLUDE[](~/fundamentals/openapi/includes/aspnetcore-openapi6-8.md)]

0 commit comments

Comments
 (0)