Swagger editor examples7/12/2023 ![]() The UseSwaggerUI method call enables the Static File Middleware. The preceding code adds the Swagger middleware only if the current environment is set to Development. Run the following command: dotnet add TodoApi.csproj package Swashbuckle.AspNetCore -v 6.2.3Īdd the Swagger generator to the services collection in Program.cs: () ī() Įnable the middleware for serving the generated JSON document and the Swagger UI, also in Program.cs: if (()) Run the following command from the Integrated Terminal: dotnet add TodoApi.csproj package Swashbuckle.AspNetCore -v 6.2.3 Select the latest "Swashbuckle.AspNetCore" package from the results pane and click Add Package.Ensure the "Show pre-release packages" option is enabled.Set the Add Packages window's Source drop-down to "".Right-click the Packages folder in Solution Pad > Add Packages. ![]() Select the latest "Swashbuckle.AspNetCore" package from the Browse tab and click Install.Enter "Swashbuckle.AspNetCore" in the search box.Ensure the "Include prerelease" option is enabled.Right-click the project in Solution Explorer > Manage NuGet Packages.csproj file existsĮxecute the following command: Install-Package Swashbuckle.AspNetCore -Version 6.2.3 Go to View > Other Windows > Package Manager Console
0 Comments
Leave a Reply. |