1 從NUGET添加組件“Swashbuckle.AspNetCore”
相關(guān)使用代碼
var builder = WebApplication.CreateBuilder(); builder.Services.AddControllers(); var app = builder.Build(); app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); app.RunAsync("http://localhost:9797");
參考文檔:
https://learn.microsoft.com/zh-cn/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-8.0&tabs=visual-studio
https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/tutorials/web-api-help-pages-using-swagger/samples/
浙公網(wǎng)安備 33010602011771號