Strangely, the deployed API works though getting publish error! Just got confused on the error message!
Adding swagger
Rajarajacholan Krishnamurthy
21
Reputation points
Even though I have added AddSwaggerGen in ConfigureService, Why I am still getting the error message:
Be sure that the Startup.cs for your application is calling AddSwaggerGen from within ConfigureServices in order to generate swagger
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo
{
Title = "HPlusSports API",
Version = "1.0",
Description = "Product API for HPlusSports"
});
});
}
1 answer
Sort by: Most helpful
-
Rajarajacholan Krishnamurthy 21 Reputation points
2023-08-22T13:47:26.9133333+00:00