cancel
Showing results for 
Search instead for 
Did you mean: 

Swagger documentation added to my API but - how to prevent redirection to petstore example.

Occasional Visitor

Swagger documentation added to my API but - how to prevent redirection to petstore example.

and it works great if you use

 

localhostSmiley Tongueort/Swagger

 

however, if the user specifies 

localHostSmiley Tongueort/Swagger,
swagger defaults to the petstore example.

This looks bad. How can this be disabled.

 

aspnetcore 3.1 and 
"Swashbuckle.AspNetCore" Version="5.0.0" 
"Swashbuckle.AspNetCore.Swagger" Version="5.0.0" 

app.UseSwagger();
app.UseSwaggerUI(c =>
{
   c.SwaggerEndpoint(@"/swagger/v1/swagger.json", "Versioned API v1.0");
});

 

thanks