swaggerswagger-uiswashbucklenswag

Swagger UI Freeze/Crash - Asp.Net Core 3.1. Any fix?


I use swashbuckle in my ASP.Net Core 3.1 with swagger UI. When I click on a model, the whole webpage crashes/freezes. I use a lot (100 approx) Entity Framework Core entities (7000 lines of JSON).

I switched to Nswag to see if it would be better. No more crashes but still quite slow (10 seconds when you click on a model, 20 on a method)

Should I make DTOs or is there a solution for my problem?

I also tried adding this to my startup but it does not help at all.

     services.AddControllers().AddNewtonsoftJson(x =>
        {
            x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
        });

Solution

  • I ended up switching to NSwag and using DTOs. The lag/crash is gone.