Asp.net core swagger not showing parameter description
In order to display the description of the parameter specified in the action.
You have to enable xml generation in your project property and enable it in swagger option.
services.AddSwaggerGen(swagger =>
{
swagger.SwaggerDoc("v1", new OpenApiInfo { Title = "ArchiveOne WebApi", Version = "v1" });
var basePath = PlatformServices.Default.Application.ApplicationBasePath;
foreach (var name in Directory.GetFiles(basePath, "*.XML", SearchOption.AllDirectories))
{
swagger.IncludeXmlComments(name);
}
});
Comments
Post a Comment