Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change url of Swagger SpringMVC UI

I use swagger-springmvc in a spring-boot project and everything works fine but when I add the swagger-spring-mvc-ui dependency to my project, swagger-ui overloads my request mapping for the base url. I'm pretty shure there's a way to point the UI to another url. Does anybody know how to change the default-path of swagger-ui?

like image 370
Daniel Avatar asked Oct 19 '22 14:10

Daniel


1 Answers

You are using old version 0.8.8 which from com.mangofactory

I recommend you to use version 2.3.1 from io.springfox

Note: If you follow the tutorial you can access swagger without having to download Swagger-UI manually

http://localhost:8080/your-app-root/swagger-ui.html

Document Url is now available at

http://localhost:8080/your-app-root/v2/api-docs

You can change document url by specifying a property source in appication.properties file using

springfox.documentation.swagger.v2.path

reference to the changes

spring boot demo

tutorial

like image 103
Chhorn Elit Avatar answered Oct 29 '22 02:10

Chhorn Elit