You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -94,10 +98,47 @@ A NuGet package must be added to support the database used in this tutorial.
94
98
95
99
[!INCLUDE[](~/includes/package-reference.md)]
96
100
97
-
### Test the project
101
+
### Test the Project
102
+
103
+
The project template creates a `WeatherForecast` API with OpenAPI JSON documentation. By default, you can access the documentation while the project is running by navigating your browser to `https://localhost:<port>/openapi/v1.json`, where `<port>` is a randomly chosen port number set during project creation.
104
+
105
+
To use the [Swagger](xref:tutorials/web-api-help-pages-using-swagger) UI for testing the API, you need to modify the `Program.cs` file in your project.
106
+
107
+
#### Steps:
108
+
1. Add `SwaggerUI` to the app.
109
+
2. Set the `SwaggerEndpoint` to the location of your OpenAPI documentation.
110
+
111
+
#### Updated `Program.cs`
112
+
113
+
```csharp
114
+
varbuilder=WebApplication.CreateBuilder(args);
98
115
99
-
The project template creates a `WeatherForecast` API with support for [Swagger](xref:tutorials/web-api-help-pages-using-swagger).
116
+
// Add services to the container.
117
+
builder.Services.AddControllers();
118
+
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
0 commit comments