Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swagger UI page not rendering properly. #685

Closed
sstrange opened this issue Mar 16, 2016 · 12 comments
Closed

swagger UI page not rendering properly. #685

sstrange opened this issue Mar 16, 2016 · 12 comments

Comments

@sstrange
Copy link

I've followed the instructions in the readme.md and am able to get my raw swagger JSON at "http://localhost:16715/swagger/docs/v1" with all my routes and XML comments. I can copy/paste this into editor.swagger.io and it displays ok.

But "http://localhost:16715/swagger/" is not rendering. This is the screenshot with javascript console. Can anyone point me in the right direction?

image

@langdonx
Copy link

Either jQuery fails to load or your iisexpress is hosed. What's the first error? It's not included in the screenshot. What does the Network tab look like?

@sstrange
Copy link
Author

The screenshot below has the first error and the network tab.
If I add the entire /dist folder from the Swagger UI repo to the project as static files and point the index.html to /swagger/docs/v1, that will work. I don't understand why /swagger/ui/index isn't working.

image

@langdonx
Copy link

Looks like IIS or Chrome is not able to download your scripts. What does jquery-1-8-0-min-js look like when you open it in a new tab?

@sstrange
Copy link
Author

jquery-1-8-0-min-js in a new tab.
Looks like it's getting cut off somehow.

image

@JT-Bruch
Copy link

@sstrange Were you able to get this resolved? I am having the same issue except it can't find any of the referenced resources in the index.html. I've tried a number of different combinations, but nothing seems to be working.

I can inject JS & CSS just fine, but when I try custom content and replacing the included index.html I get the same result.

@sstrange
Copy link
Author

No. I ultimately commented out .EnableSwaggerUi() in SwaggerConfig and added the /dist folder as static files. I've been using it like that.

Strangely I found it only had the issue on localhost. When deployed /swagger was working.

@rbonestell
Copy link

rbonestell commented May 13, 2016

I, too, am experiencing this issue when injecting a custom index.html file.

[EDIT]
I solved my problem! My index.html file was in a folder named "Swagger" within my project. Renaming this folder to something else (I chose "SwaggerCustom") fixed the issue! I hope this helps!

@domaindrivendev
Copy link
Owner

Are people still experiencing an issue here? Will go ahead and close if no response in the next couple of days

@JT-Bruch
Copy link

Actually! I was able to get it fixed @sstrange. Basically you need to replace the periods with dashes in the various script and stylesheet includes.

@bys-wallance-zhang
Copy link

the root cause is the "Swashbuckle.core" source code we build to dll not include "css" "lib" "images",these are different Swashbuckle.core.dll get from nuget.

@MurtuzaTravadi
Copy link

i am facing same issue

@erivics
Copy link

erivics commented Mar 16, 2022

I install Swashbuckle.AspNetCore 6.2.3. Configuration properly done but the display is this. Please I need help
swagger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants