Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Springfox Swagger generating requests with port 80 for HTTPS URLS

I am experiencing an issue using springfox-swagger2 v2.2.0 related to the request padding port 80 for a HTTP URL.

Is there anyway to disable the generation of the port or set the port to 443 programmatically based on a Spring Profile?

Generated CURL:

curl -X GET --header "Accept: application/json" "https://test.com:80/api/users/search"

like image 625
jz15 Avatar asked Oct 14 '15 05:10

jz15


1 Answers

Hit the same issue, but rather than upgrade the spring framework libraries as per @Akshay answer (thanks for pointing out the Swagger2Controller.class), I added the following property to my application-dev.yml file (replace hostname with your host).

springfox.documentation.swagger.v2.host: hostName:443

like image 167
Grant Lay Avatar answered Oct 02 '22 03:10

Grant Lay