0
votes

I have a WebAPI service, written in ASP.NET (not Core), for which I am trying to generate documentation, in order to allow other devs to use it. I found Swashbuckle, and installed it. Then, since I also use OData for some of my services, I added Swashbuckle.OData. Then, I modified the CustomProvider setting in SwaggerConfig to use the ODataSwaggerProvider. I also set ResolveConflictingActions(apiDescriptions => apiDescriptions.First()) because I had a few Actions with the same URL path, differing only by query string (I'll need to address that later). So far so good.

Then, I tested it. I started my web app, then added "/swagger/" to then end. I got a message stating that it was loading the resource info. However, after several minutes, I got a browser error debug popup, stating "Error: Not enough storage is available to complete this operation." It asks if I want to debug, and if I do, it takes me to the debugger in IE (the browser I'm using). The only code in the stack is either from jquery-1-8-0-min-js or swagger-ui-min-js (this part confuses me, as there is no "swagger-ui-min-js" file in my project; I'm assuming it's embedded in the dll). There is no part of the stack trace that floats back up to my code, and all the code there is minified, so it's very difficult to debug.

However, I do know that it is at least partially working, as three of the controllers do show up in the resulting page after you close the error popup. You can navigate through them, and all the GETs, POSTs, PUTs, and DELETEs seem to be there, and you can test them.

Is it the case that whenever you navigate to the "/swagger/" url, Swagger hits all the URLs in the service, in order to generate the documentation? I'm wondering if maybe it is hitting an action that is taking a particularly long time to run, or possibly its generated documentation is taking too much disk space (I have plenty of space on my disk, but maybe it is referring to RAM?).

Anyway, even if that were not an issue, how can I get it to generate something, some kind of document file, that I can send off to someone? I see no new files added to my folders, so it would seem that it re-does the whole process every time you navigate to the swagger URL.

1
It is nearly impossible to troubleshoot this without any code... Can you put your code on GitHub? - Helder Sepulveda
I can't really put the code up on GitHub. Maybe I could try to make a dummy project that exhibits the same behavior. But I guess I'm asking more on a higher level, "What is Swashbuckle actually doing here?" so I can make better guesses at what the problem is. On a theoretical level, if I have an Action that takes too long to run, or that returns a lot of data, would that cause this "not enough storage is available" message? Like, would would theoretically cause that message to show? - RebelScum
I would recommend you to get familiar with Swashbuckle start with a simple WebAPI project and add Swashbuckle, see how it look. Then start adding some of the complex feature of your project see where it breaks. - Helder Sepulveda
Have you been able to create a dummy project reproducing your issue? - Helder Sepulveda
I did not, but when I tried in Chrome, I did not have the issue, oddly enough (I was using IE11 before). - RebelScum

1 Answers

0
votes

When I tried the Chrome browser, I no longer had the issue (I was using IE11 before). Not sure what the problem was, but this was the workaround.