Forum Discussion
rajiadi
New Contributor
Hi ponelat, thanks for the response. But in this document, it asks us to configure the swagger url with /rest/ . Is there any way I can use something else instead of rest in the path? say /api/? It doesn't work if there is no /rest/ in the path
ponelat
2 years agoStaff
rajiadi sounds like you're looking to change the `basePath`.
You can do so via web.xml, see: https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5#using-swaggers-servlet-in-the-webxml
Replace
<param-value>http://localhost:8080/api</param-value>
With the value you need, perhaps: `http://localhost/rest`?
Or you can change it via beanConfig, see: https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5#using-swaggers-beanconfig
beanConfig.setBasePath("/rest");
Related Content
- 4 years ago
- 2 years ago
- 3 years ago