builder.Services.AddSwaggerGen(options =>
{
options.SwaggerDoc("v1", new OpenApiInfo
{
Version = "v1",
Title = "my title",
Description = "",
TermsOfService = new Uri("https://google.com.sa/"),
Contact = new OpenApiContact
{
Name = "Example Contact",
Url = new Uri("")
},
License = new OpenApiLicense
{
Name = "Example License",
Url = new Uri("https://google.com.sa/")
}
});
// using System.Reflection;
var xmlFilename = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
options.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename));
});
app.UseSwagger();
app.UseSwaggerUI();
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
var xmlFilename = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
options.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename));