From 4a846f43ace085d9c8463ddbdc384830faacd345 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Wed, 29 May 2024 08:51:45 -0700 Subject: [PATCH] Bring back OpenAPI package installation instructions (#32695) --- .../minimal-apis/aspnetcore-openapi.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/aspnetcore/fundamentals/minimal-apis/aspnetcore-openapi.md b/aspnetcore/fundamentals/minimal-apis/aspnetcore-openapi.md index e3188647b2..ec0b52eb62 100644 --- a/aspnetcore/fundamentals/minimal-apis/aspnetcore-openapi.md +++ b/aspnetcore/fundamentals/minimal-apis/aspnetcore-openapi.md @@ -17,6 +17,46 @@ The [`Microsoft.AspNetCore.OpenApi`](https://www.nuget.org/packages/Microsoft.As * Provides a [transformers](#transformers) API for modifying generated documents. * Supports managing multiple OpenAPI documents within a single app. +## Package installation + +The `Microsoft.AspNetCore.OpenApi` package can be added with the following approaches: + +### [Visual Studio](#tab/visual-studio) + +* From the **Package Manager Console** window: + * Go to **View** > **Other Windows** > **Package Manager Console** + * Navigate to the directory in which the `.csproj` file exists + * Execute the following command: + + ```powershell + Install-Package Microsoft.AspNetCore.OpenApi -IncludePrerelease + ``` + +* From the **Manage NuGet Packages** dialog: + * Right-click the project in **Solution Explorer** > **Manage NuGet Packages** + * Set the **Package source** to "nuget.org" + * Ensure the "Include prerelease" option is enabled + * Enter "Microsoft.AspNetCore.OpenApi" in the search box + * Select the latest "Microsoft.AspNetCore.OpenApi" package from the **Browse** tab and click **Install** + +### [Visual Studio Code](#tab/visual-studio-code) + +Run the following command from the **Integrated Terminal**: + +```dotnetcli +dotnet add package Microsoft.AspNetCore.OpenApi --prerelease +``` + +### [.NET Core CLI](#tab/netcore-cli) + +Run the following command: + +```dotnetcli +dotnet add package Microsoft.AspNetCore.OpenApi --prerelease +``` + +--- + ## Configure OpenAPI document generation The following code: