- Swagger
- SwaggerGen
- SwaggerUI
SwaggerUI
https://localhost:7147/swagger
SwaggerEndpoint
https://localhost:7147/swagger/v1/swagger.json
Package installation
Install the package on the exiting TodoAPI project
By changing Program.cs, you can make root url to point to Swagger.
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseSwagger();
//app.UseSwaggerUI();
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "v1");
options.RoutePrefix = string.Empty;
});
}
BEFORE:
AFTER:
XML Comments etc seems not working when I tried.
No comments:
Post a Comment