Closed KumG closed 5 years ago
Hello,
I have a Web API project and I'm using the Owin middleware :
RouteTable.Routes.MapOwinPath("swagger", app => { app.UseSwaggerUi3(typeof(MyProject).Assembly, s => { s.GeneratorSettings.Title = "MyAPI"; s.MiddlewareBasePath = "/swagger"; }); });
SwaggerUI is then accessible with the URL "http://localhost/myproject/swagger/index.html" and the swagger file with "http://localhost/myproject/swagger/v1/swagger.json ". The base URL is "localhost/myproject" and my methods are like "/api/persons"
Instead, I would like to use the URL "http://localhost/myproject/api/index.html" for the swaggerUI.
Is it possible ?
I tried to follow this guide but I use the path "api" :
<add name="NSwag" path="api" verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
The swagger UI is at the good URL but my API doesnt work anymore.
I finally used the Owin Startup class with "s.SwaggerUiRoute = "/api";"
Hello,
I have a Web API project and I'm using the Owin middleware :
SwaggerUI is then accessible with the URL "http://localhost/myproject/swagger/index.html" and the swagger file with "http://localhost/myproject/swagger/v1/swagger.json ". The base URL is "localhost/myproject" and my methods are like "/api/persons"
Instead, I would like to use the URL "http://localhost/myproject/api/index.html" for the swaggerUI.
Is it possible ?
I tried to follow this guide but I use the path "api" :
<add name="NSwag" path="api" verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
The swagger UI is at the good URL but my API doesnt work anymore.