To generate OpenApi.json
on build from an ASP.NET 8 Minimal API, follow these steps:
-
In Visual Studio for Windows 17.7.0 or later, create a new
ASP.NET Core API
project -
Follow these instructions to install
Swashbuckle.AspNetCore.Cli
as a local dotnet tool in your project -
Add these NuGet packages (or later versions) to the project:
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0-preview.4.23260.4" />