mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
feat(dir-swagger): ✨ surface XML comments from Contracts & Application models
This commit is contained in:
parent
d8f1af4ec7
commit
f7ced71f7c
3 changed files with 23 additions and 15 deletions
|
|
@ -4,6 +4,7 @@
|
|||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -9,23 +9,29 @@ public static void AddSwaggerGen(this IServiceCollection services)
|
|||
{
|
||||
services.AddSwaggerGen(o =>
|
||||
{
|
||||
o.SwaggerDoc("v1", new OpenApiInfo
|
||||
{
|
||||
Title = "FilterLists Directory API",
|
||||
Description = "An ASP.NET Core API serving the core FilterList information.",
|
||||
Version = "v1",
|
||||
//TermsOfService = "",
|
||||
Contact = new OpenApiContact { Name = "FilterLists", Url = new Uri("https://filterlists.com") },
|
||||
License = new OpenApiLicense
|
||||
o.SwaggerDoc("v1",
|
||||
new OpenApiInfo
|
||||
{
|
||||
Name = "MIT License",
|
||||
Url = new Uri("https://github.com/collinbarrett/FilterLists/blob/master/LICENSE")
|
||||
}
|
||||
});
|
||||
Title = "FilterLists Directory API",
|
||||
Description = "An ASP.NET Core API serving the core FilterList information.",
|
||||
Version = "v1",
|
||||
//TermsOfService = "",
|
||||
Contact = new OpenApiContact { Name = "FilterLists", Url = new Uri("https://filterlists.com") },
|
||||
License = new OpenApiLicense
|
||||
{
|
||||
Name = "MIT License",
|
||||
Url = new Uri("https://github.com/collinbarrett/FilterLists/blob/master/LICENSE")
|
||||
}
|
||||
});
|
||||
|
||||
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
||||
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
|
||||
o.IncludeXmlComments(xmlPath);
|
||||
var apiXmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
||||
o.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, apiXmlFile));
|
||||
|
||||
var apiContractsXmlFile = $"{typeof(Contracts.ConfigurationExtensions).Assembly.GetName().Name}.xml";
|
||||
o.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, apiContractsXmlFile));
|
||||
|
||||
var applicationXmlFile = $"{typeof(Application.ConfigurationExtensions).Assembly.GetName().Name}.xml";
|
||||
o.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, applicationXmlFile));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
|||
Loading…
Reference in a new issue