I find the version of Swagger-UI that ships with ServiceStack (6.11 or earlier) to be hopelessly slow with larger API’s. I’ve experimented with the latest Swagger-UI and it’s at least 100 times faster on the intial load compared to the current version ServiceStack uses.
So, I’ve embarked on an effort to see what I need to do to use the latest Swagger-UI.
I’ve been reading the docs on replacing the built-in ServiceStack embedded resources relating to Swagger-UI on Open API
If I put the latest Swagger-UI files in a swagger-ui folder, when clicking the Swagger-UI link on the metadata page the OpenAPIFeature adds does use the new Swagger-UI - but it’s not setting the URL for the openapi document to be the /openapi of the API.
I’ve tried a few things like editing the swagger-initializer.js as per the swagger-ui docs, but nothing seems to work - it still is the http://petstore.swagger.io/v2/swagger.json default.
The OpenApiFeature plugin must be weaving some magic to set that URL, but I can’t see where when looking in ServiceStack/src/ServiceStack.Api.OpenApi/OpenApiFeature.cs.
Is there a simple way to use the latest Swagger-UI?
I have no idea why I didn’t properly parse that! I saw the petstore URL and did not cognitively process the fact it was performing a .Replace() of the html document.