SwashBuckle UI in .Net Core 2.0 showing error

Viewed 354

I have just install Swashbuckle.AspNetCore 5.6.3 and do all the configurations where needed.

when I run the debugger and got the localhost:65183/swagger/index.html from by browser it is showing the following error in console:

Uncaught TypeError: Cannot read property 'forEach' of undefined at window.onload (index.html:51) window.onload @ index.html:51 load (async) (anonymous) @ index.html:46

I have the following folder structure. Here is screenshot of my Project in Visual Studio.

Project Structure

1 Answers

I figured out the problem. I missed a line in the configuration.

This line

app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
            });
Related