Custom UI - but keep most of SwaggerUI

1,351 views
Skip to first unread message

Steve Webster

unread,
Apr 2, 2015, 1:14:58 PM4/2/15
to swagger-sw...@googlegroups.com
Hello,
Based on project requirements, I would like to add some custom features/sections to the Swagger UI.  

So far I have c.CustomAsset("index", thisAssembly, "Path.That.Isnt.Fake.App_Start.SwaggerResources.index.html");
index.html is an embedded resource that is a copy of the github index file, and it comes up when I access the /swagger url, Great!

Unfortunately, all the data is missing.  I no longer see my API endpoints displayed.  What may have I missed when moving to the custom html file?

Thank you,
Steve
Message has been deleted

Steve Webster

unread,
Apr 2, 2015, 2:09:11 PM4/2/15
to swagger-sw...@googlegroups.com
As an update - It also looks like I am missing the CSS, even though the page(attached)  references the files.  Is this just a simple problem of not pointing to the correct location now that I am using the custom page?
index.html

Steve Webster

unread,
Apr 2, 2015, 6:10:23 PM4/2/15
to swagger-sw...@googlegroups.com
Solved - the link in the documentation for SwashBuckle "For compatibility, you should base your custom "index.html" off this version", the link shows the script imports like this.
  <script src='swagger-ui.js' type='text/javascript'></script>
The correct value is   <script src='swagger-ui-js' type='text/javascript'></script>

The difference is .js vs -js.  all the periods in all the script imports need to be replaced with a dash.

Marta Doberschuetz

unread,
May 22, 2015, 7:16:43 AM5/22/15
to swagger-sw...@googlegroups.com
I had the same problem and changing all dots to dashes solved the problem...
Reply all
Reply to author
Forward
0 new messages