1

I have a WebApi project with Swashbuckle installed onto it.

By default, API documentation is accessible at URL http://localhost:4444/swagger/ui/index. I used the next approach https://stackoverflow.com/a/38614984/7819575. But it doesn't work correctly. I can get worked it by changing the url from "/swagger/ui/index" to "/swagger/swagger/ui/index".

My sample:

    [Route(""), HttpGet]
    [ApiExplorerSettings(IgnoreApi = true)]
    public HttpResponseMessage RedirectToSwaggerUi()
    {
        var httpResponseMessage = new HttpResponseMessage(HttpStatusCode.Found);
        httpResponseMessage.Headers.Location = new Uri("/swagger/swagger/ui/index", UriKind.Relative);
        return httpResponseMessage;
    }

Can anyone help me to get worked url "/swagger/ui/index"?

Anri
  • 41
  • 7

0 Answers0