SwaggerDoc is not recognized.
What works for me is something like:
services.AddSwaggerGen(swagger =>
{
swagger.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" });
swagger.IncludeXmlComments(Path.Combine(PlatformServices.Default.Application.ApplicationBasePath, "MyApi.xml"));
});
I was using wrong version, correct version is Install-Package Swashbuckle.AspNetCore -Pre. I was using something else.
Most helpful comment
What works for me is something like: