swagger

add package:
NSwag.AspNetCore

startup.cs

public void ConfigureServices(IServiceCollection services)
{
    services.AddControllers();
    services.AddOpenApiDocument();
}

Configure(IApplicationBuilder app, IWebHostEnvironment env)
...(after endpoints)...
app.UseOpenApi();
app.UseSwaggerUi3();

goto url localhost:5000/swagger