I have an ASP.NET WebAPI project where I am attempting to replace our old XmlDocumentationProvider page with Swagger UI. I am using the swashbuckle swagger for webAPI 5.3.1
I was able to comment out each of my API controllers, load the swagger page, and then turn them back on until the page crashed again. Once I figured out which controller was the issue, I repeated the process with all of the endpoints in the controller.
It turned out that one of our very old methods was taking an ORM entity as a body parameter (very bad), which was causing swagger to try to parse our entire ORM object graph and running out of memory. Changing this method to accept a DTO instead of data layer entity solved the problem.