Swagger Configuration for base url

11/11/2019

I have my Spring boot application deployed using the Kubernetes cluster. I have swagger configured using springfox.documentation.*

Now on the swagger page when I use "Try it out" button, and submit an API request the Request Url is formed like https://java:9080/api/customer/order Which should be https://application.domain.com/api/customer/order

The swagger page opens at https://application.domain.com/swagger-ui.html#

Any idea how could it be fixed?

-- Abhinav Prakash
kubernetes
spring-boot
springfox
swagger
swagger-2.0

1 Answer

11/11/2019

You need to configure the swagger ui to use your server. Look at this document.

Looks like setting the URL environment variable for the swagger UI should work. For better control, you can get a copy of the dist/index.html page, edit it with your configuration options, and mount it into the swagger container.

-- Burak Serdar
Source: StackOverflow