swagger返回參數的註釋

.net core3.0 webapi 首先安裝包Swashbuckle.AspNetCore.Annotations 然後在Startup配置swagger地方加上一句代碼 i.EnableAnnotations();//註釋 使用的話在控制器的方法中加上 [SwaggerResponse(0,"文檔註釋",typeof(Product))] 注意這個typeof的參數就是你要返回的類型 這樣配
相關文章
相關標籤/搜索