Swashbuckle.webapi: Swagger UI not loading

Created on 19 Jun 2018  ยท  11Comments  ยท  Source: domaindrivendev/Swashbuckle.WebApi

I am using Swashbuckle , collected from Nuget, https://www.nuget.org/packages/Swashbuckle/, I have a web API project It's little bit complex project and has lots of 3rd party API call inside the API project , also we have used EF for sql server access. Problem i am facing swagger can not load UI , in chorme getting exception like "Failed to load resource: net::ERR_CONNECTION_RESET" No UI element is loading ,
Interestingly other Small API projects which are small in size is working perfectly but not with this one .
I have tried to open those JS , CSS file directly in new Tab of chorme , its working . but not full page . CSS and JS are taking too long to load.

VERSION:

Its 5.6.0

So my question is 'Is this happen because API has lots of methods /endpoint ? How to over come ? Should i try lower versions ? in some post i found its due to Base URL issue , not sure , because in current version i did not found Base url resolver methods .
Please guide me , as i told this is main API , i need this documentation and testing environment much here

Most helpful comment

Guys, I have great news! I've fixed this issue. Probably you have the same reasons.

So, I have the same behavior - locally SwaggerUI page loads correctly, but on the environment it fails.

Thank's its very helpful, i solve my issue too ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ

All 11 comments

image
This is Error in Ghorme

And yeah some time like this , all 200 ok but red
image

Any one have any feedback on this , or i can not use it as my business API have so many API endpoints
?

Having the same problem. Did you manage to solve it somehow?

Having the same problem. Any news?

Its not load for me so i give up

On Wed, 6 Nov 2019 at 17:32, Roman Marusyk notifications@github.com wrote:

Having the same problem. Any news?

โ€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/domaindrivendev/Swashbuckle/issues/1248?email_source=notifications&email_token=ABOC5WULFV2NW4DH5RHK573QSKW4LA5CNFSM4FFUOV22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDGJQ7Y#issuecomment-550279295,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABOC5WWXEYYL6CEDC6AENGDQSKW4LANCNFSM4FFUOV2Q
.

--
Tanmay Mandal
Team Lead
[image: banner]
Address: AQ 7, 6th Floor, Ambient Building,
Saltlake Sector V, Kolkata 700091
Office Phone: +91 33 4004-0627 <+91334004-0627>

I've faced the same issue. Is there any news?

Guys, I have great news! I've fixed this issue. Probably you have the same reasons.

So, I have the same behavior - locally SwaggerUI page loads correctly, but on the environment it fails.

Guys, I have great news! I've fixed this issue. Probably you have the same reasons.

So, I have the same behavior - locally SwaggerUI page loads correctly, but on the environment it fails.

Thank's its very helpful, i solve my issue too ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ

Guys, I have great news! I've fixed this issue. Probably you have the same reasons.

So, I have the same behavior - locally SwaggerUI page loads correctly, but on the environment it fails.

So, what is the fix?

Guys, I have great news! I've fixed this issue. Probably you have the same reasons.
So, I have the same behavior - locally SwaggerUI page loads correctly, but on the environment it fails.

So, what is the fix?

I'm so sorry, my answer wasn't completed :(

So, for the environment, we have a configuration that enables our custom DelegatingHandler which is responsible for decoding/encoding requests/responses using gzip and deflate. And there was a bug that didn't reproduce with the old version of Swashbuckle for some reason(responses didn't contain some data which triggers encoding).

The bug was in the setting the wrong value for the "Content-Length" header - the value was the length of the real content but before the encoding and as the result after encoding, a response had a less length. Browsers process such header and compare the actual length and the expected(the value in the header) and if the actual length is less than expected browsers idle by waiting for the rest of the response.

In my case the idle performs about 2 minutes and after that requests were rejected by the browser. I've solved the issue by removing this header from the response and after that everything works OK.

Sorry again for my useless previous comment again. Hope, this helps you in solving your issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

djem3000 picture djem3000  ยท  5Comments

qwertykeith picture qwertykeith  ยท  5Comments

rautsik picture rautsik  ยท  4Comments

joseph-ortiz picture joseph-ortiz  ยท  4Comments

kmmacgill picture kmmacgill  ยท  3Comments