rbeauchamp/Swashbuckle.OData

Swashbuckle.OData.Core is too slow, consume 60% memory while open swagger in chrome browser

Closed this issue · 4 comments

@rbeauchamp
Version : 5.6.0
OData : v4
Controller list : upto 350 and each has 5 functions

This is not an odata issue, particularly if you talk about memory in chrome - it is a swagger issue. And 60% memory is very relative - compared to what? Definitly not 60% of my 64gb memory ;)

I always felt that the swagger approach is extremely non scaling - loading all the document and generating all the html is bound to lead to brutally large documents for any non trivial API. No way around it until someone makes a UI that stores the API document on the server and the client only pulls the parts it needs to show the part of the UI the user is currently interested in.

350 controllers with 5 functions each is definitely something way out of the specs of the Swagger standard UI, me thinks - though not really THAT large and sensible.

You don't have to use the standard Swagger UI. Have you tried different OpenAPI user interfaces?

Eg. a few examples I'm aware of :
https://github.com/Redocly/redoc
https://github.com/mrin9/RapiDoc
https://github.com/darosh/oax

Often you can just point their demo site at your swagger definition and try it out.

Yeah. Basically something where the whole document is not transferred to the backend. I.e. a backend API that allows multiple level queries:

  • List of all endpoints
  • Detail per endpoint

That way you could only generate the HTML when an item is open.

The current approach has limited scalability because you transfer everything into the client.