Monday, May 14, 2018

Error in swagger Swagger/ui/index or http://localhost:57928/swagger/docs/v1


When you access to the swagger url: http://localhost:28483/swagger/ui/index, it generates this error:
500 : undefined http://localhost:28483/swagger/docs/v1


Solution:-

Open swagger configs. Go to App_Start\SwaggerConfig.cs file and under EnableSwagger lambda expression add this line:



c.SchemaId(x => x.FullName);

Full code is like this:
GlobalConfiguration.Configuration 
    .EnableSwagger(c =>
    {
        // your configs...

        c.SchemaId(x => x.FullName);

        // other configs...
    })
    .EnableSwaggerUi(c =>
        // ....
    });

Using this i thing problem will be resolve 

Thank you.

No comments:

Post a Comment