Bring back OpenAPI package installation instructions (#32695)

pull/32689/head
Safia Abdalla 2024-05-29 08:51:45 -07:00 committed by GitHub
parent 54cbf415b7
commit 4a846f43ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 40 additions and 0 deletions

View File

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