You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using: <PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.1" /> in netcoreapp3.1
With setup:
// part of the Configure in startup with IApplicationBuilder builder// serviceOptions.BasePath resolves to "/SomePath"
builder.UsePathBase(serviceOptions.BasePath);
builder.UseRouting()// Swagger routing needs to occur before authentication/authorization otherwise it will result in 401 Unauthorized.UseSwagger(options => options.RouteTemplate ="/swagger/{documentName}/swagger.json").UseSwaggerUI(options =>{// When a base path has been set ensure the swagger endpoint includes it, otherwise the redirects will go to the// wrong location and no help will be visible options.SwaggerEndpoint($"{serviceOptions.BasePath}/swagger/v1/swagger.json","API v1"); options.RoutePrefix ="help";})
I am running into a strange problem:
I get access to the swagger UI on urls: http://localhost:8080/SomePath/help/index.html http://localhost:8080/help/index.html
but when trying to go to http://localhost:8080/SomePath/help
redirect happens to http://localhost:8080/SomePath/SomePath/help/index.html
and of course it hits 404
Any idea what is the cause of this reroute?
Thanks
The text was updated successfully, but these errors were encountered:
I recall a lot of back and forth in this part of the code and so can't be sure when this exact issue was fixed, but I just tested this myself with the latest code and it appears to work as expected. I'm working hard to get a 6.0.0 release out next week but in the meantime you can pull down the latest perview build from myget.org and try it out. Be sure to clear the browser cache first.
Using:
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.1" />
innetcoreapp3.1
With setup:
I am running into a strange problem:
I get access to the swagger UI on urls:
http://localhost:8080/SomePath/help/index.html
http://localhost:8080/help/index.html
but when trying to go to
http://localhost:8080/SomePath/help
redirect happens to
http://localhost:8080/SomePath/SomePath/help/index.html
and of course it hits 404
Any idea what is the cause of this reroute?
Thanks
The text was updated successfully, but these errors were encountered: