I have below URL working in my Spring Boot project.
http://localhost:8080/swagger-ui/index.html
I would like to shorten it to something like
http://localhost:8080/docs/index.html
I have tried adding
springdoc.swagger-ui-path: /docs/index.html
to my application.yml but it will then redirect me to
http://localhost:8006/docs/swagger-ui/index.html
I have also tried making a custom controller that would redirect me like below but it still sends me to the same swagger-ui link.
public class SwaggerController {
@RequestMapping("/docs/index.html")
public void apiDocumentation(HttpServletResponse response) throws IOException {
response.sendRedirect("/swagger-ui.html");
}
}