I try to use Swagger with Microsoft WebAPI 2.
For the moment, I\'ve the following call in a method.
appBuilder
.ConfigureOAuth()
.UseWebApi(con
I had similar problem and I solved it by customizing SwaggerUI url. This is my Configuration method:
public void Configuration(IAppBuilder app)
{
var thisAssembly = typeof (Startup).Assembly;
HttpConfiguration httpConfig = new HttpConfiguration();
app.MapHttpAttributeRoutes();
app.UseCors(CorsOptions.AllowAll);
app.UseWebApi(httpConfig);
httpConfig
.EnableSwagger("api/{apiVersion}",c =>
{
c.IncludeXmlComments(string.Format(@"{0}\bin\Docs.xml", AppDomain.CurrentDomain.BaseDirectory));
c.SingleApiVersion("v1", "My API");
})
.EnableSwaggerUi("{*assetPath}",c =>
{
c.CustomAsset("index", thisAssembly, "AspNetIdentity.WebApi.DocsAssets.index.html");
});
httpConfig.Routes.First(x => x.RouteTemplate == "{*assetPath}").Defaults["assetPath"] = "index";
}
This way when You go to localhost:44300
You'll get Swagger UI as startup page.