添加swagger备注

先在api右键属性

 

在Program里面:

builder.Services.AddSwaggerGen(a =>
{
string path = AppDomain.CurrentDomain.BaseDirectory + "Demo.WebApi.xml";
a.IncludeXmlComments(path, true);
});

posted @ 2023-10-23 11:17  想睡觉的小坤  阅读(106)  评论(0)    收藏  举报