Добавил поддержку документации плагинов

This commit is contained in:
2025-10-14 23:18:26 +03:00
parent 498a183be5
commit ec389bb596

View File

@@ -109,6 +109,14 @@ builder.Services.AddSwaggerGen(options =>
var pluginXmlPath = Path.Combine(AppContext.BaseDirectory, pluginXmlFile);
options.IncludeXmlComments(pluginXmlPath);
// Добавление документации плагинов
foreach (var p in loadedPlugins)
{
var pluginXmlFullPath = p.Assembly.Location.Replace("dll", "xml");
if (File.Exists(pluginXmlFullPath))
options.IncludeXmlComments(pluginXmlFullPath);
}
// Добавляем только схему авторизации по ApiKey
options.AddSecurityDefinition(ApiKeyAuthenticationDefaults.Scheme, new Microsoft.OpenApi.Models.OpenApiSecurityScheme
{