Swagger user interface freezes after API extraction and browser crashes

I have an ASP.NET WebAPI project where I am trying to replace our old XmlDocumentationProvider page with a Swagger interface. I am using swashbuckle swagger for webAPI 5.3.1 nuget package.

I can go to localhost / MyApp / swagger, and I see in the script that it calls localhost / MyApp / swagger / docs / v1 to retrieve the JSON string representing my API. The call succeeds, JSON is around 240K, and JSON is valid. At this point, the chrome tab freezes for about 30 seconds before a crash on the Aw snap page. There are no errors in the console.

Trying to check the JSON api in this online validator works and says that the specification / scheme is valid IF AND ONLY IF I uncheck all three check the "Follow ___ $ refs" checkboxes. If any of these boxes are checked, it takes about 30 seconds, and then this tool crashes.

Unfortunately, I cannot insert the entire webAPI specification anywhere, but I will say that this is for a very large and very complex internal business application. Some of our DTOs have circular references (properties of the same type as the DTO itself), which I suspect may cause a problem, but without any logging or debugging I cannot be sure, and with more than 1000 DTO classes I do not want to wipe them all to check.

Is there a way to enable any kind of logging or debugging for swashbuckle (on the server) or the swagger user interface (on the client)? Has anyone encountered this problem when the browser crashed and knew what caused this? Thanks in advance.

+4
source share
2 answers

I managed to comment on each of my API controllers, load the spread page, and then return them back until the page crashed again. As soon as I realized which controller was the problem, I repeated this process with all the endpoints of the controller.

, ORM body ( ), . DTO .

+9

All Articles