Latest Swagger-ui NuGet ServiceStack (v 4.0.30) does not deploy swagger-ui resources folder

I have a project that uses ServiceStack with Swagger-UI, I installed and configured with v4.0.24 and recently updated to 4.0.30.

Latest ServiceStack.Api.Swagger NuGet package: https://www.nuget.org/packages/ServiceStack.Api.Swagger/ It seems that setting the resource / swagger -ui folder as the previous packaging did.

I tried this with a new clean asp.net solution for servicestack in VS2013. Added ServiceStack.Api.Swagger from nuget and enabled plugin in AppHost.cs like this:

public override void Configure(Container container)
{
    this.AddPlugin(new SwaggerFeature());
}

      

The swagger-ui function works fine, but it seems that the resources (index.html, js, css, etc.) are embedded in the dll and it needs to edit the index.html in minumum before setting up Swagger-UI.

Am I missing something, or is this a bug in the latest NuGet package?

I edited my swagger v4.0.24 html, css and js, can I retrieve them from the ServiceStack Git ( https://github.com/ServiceStack/ServiceStack/tree/master/src/ServiceStack.Api.Swagger ) and manually add / combine them into my solution?

+3


source to share


1 answer


We recommend that you check the ServiceStack release notes to find out what has changed in each version.

Notes for Swagger Change in 4.0.30 :

All static resources are now embedded

All Swagger static resources embedded in a single ServiceStack.Api.Swagger.dll , taking advantage of transparent virtual file system support for embedded resources , making it easy to manage and update Swagger as a standalone device.

This way you no longer need Swagger assets as they are now built into the dll.



Virtual file system

The docs on the virtual filesystem show how to override embedded resources :

Overriding built-in Swaggers resources

ServiceStack Virtual File System supports multiple file source locations where you can override Swagger embedded files to include your own custom files in the same location as existing embedded files. This allows you to replace the built-in ServiceStack resources with your own by simply copying the / swagger-ui or / swagger-ui-bootstrap files you want to customize and place them in your sites directory in the same paths, i.e .:

/swagger-ui
  /css
  /images
  /lib
  index.html

/swagger-ui-bootstrap
  index.html
  swagger-like-template.html

      

+8


source







All Articles