We are using Swashbuckle to add Swagger doc to my API, using the Swashbuckle Nuget package. In WebAPI\App_Start\SwaggerConfig.cs changed base url to the following below:
GlobalConfiguration.Configuration
.EnableSwagger("docs/{apiVersion}/help",c
=>
c.RootUrl(req
=> req.RequestUri.GetLeftPart(UriPartial.Authority)+ req.GetRequestContext().VirtualPathRoot.TrimEnd('/'));
.....
.....
})
.EnableSwaggerUi("help/{*assetPath}",
c =>....
If I keep everything intact,
when I navigate to **/help** - all works
- localhost/WebAPI/docs/v1/help - JSON appears and ok
- localhost/WebAPI/help/index - UI appears and works
when I navigate to **/help/**,
- localhost/WebAPI/docs/v1/help/ - JSON appears and ok
- localhost/WebAPI/help/ - UI redirects to at
localhost/WebAPI/help/help/index and we get an empty page with error
{"message":"An
error has occurred.","exceptionMessage":"Mapping
not
found -
help/index","exceptionType":"Swashbuckle.SwaggerUi.AssetNotFound","stackTrace":"
at Swashbuckle.SwaggerUi.EmbeddedAssetProvider.GetAsset(String
rootUrl, String path)\r\n at
Swashbuckle.Application.SwaggerUiHandler.SendAsync(HttpRequestMessage
request, CancellationToken cancellationToken)"}
What needs to be done to Swagger/Swashbuckle to make the path work?
We are not using OWIN.
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
.
.