برای حل Error مربوط به Error Server در Swagger
اگر در API Controller از متد و یا هر چیزی غیر از WebAPI که مرتبط با Http Verbها نمیباشد استفاده میکنیم و یا Web API ای که نمیخواهیم در Swagger نمایش داده شود از فیلتر زیر استفاده میکنیم .
[ApiExplorerSettings(IgnoreApi = true)]
var security = new Dictionary<string, IEnumerable<string>>
{
{"Bearer", new string[] { }},
};
c.AddSecurityDefinition("Bearer", new Swashbuckle.AspNetCore.Swagger.ApiKeyScheme()
{
Description = "Authorization format : Bearer {token}",
Name = "Authorization",
In = "header",
Type = "apiKey"
});
c.AddSecurityRequirement(security);
تا کنون نظری داده نشده است .
اولین کسی باشید که دیدگاه خود را ثبت می کند .
لطفا منتظر بمانید...