Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Springfox Swagger使用端口80为HTTPS URL生成请求_Swagger_Springfox - Fatal编程技术网

Springfox Swagger使用端口80为HTTPS URL生成请求

Springfox Swagger使用端口80为HTTPS URL生成请求,swagger,springfox,Swagger,Springfox,我在使用springfox-Swagger 2 v2.2.0时遇到一个问题,该问题与HTTP URL的请求填充端口80有关 是否可以根据Spring配置文件禁用端口生成或以编程方式将端口设置为443 生成的卷曲: curl-xget--header“Accept:application/json”“”我也有同样的问题。这是因为Swagger使用了Spring Framework中的一个类,该类将端口80添加到/v2/api文档json响应中的主机属性中(请检查Swagger2Controller

我在使用springfox-Swagger 2 v2.2.0时遇到一个问题,该问题与HTTP URL的请求填充端口80有关

是否可以根据Spring配置文件禁用端口生成或以编程方式将端口设置为443

生成的卷曲:


curl-xget--header“Accept:application/json”“”

我也有同样的问题。这是因为Swagger使用了Spring Framework中的一个类,该类将端口80添加到/v2/api文档json响应中的主机属性中(请检查Swagger2Controller.class)。我在SpringFramework版本4.1.4.0中遇到了这个问题。升级到最新版本4.3.2.Release解决了这个问题。

遇到了同样的问题,但我没有按照@Akshay answer升级spring框架库(感谢您指出Swagger2Controller.class),而是在application-dev.yml文件中添加了以下属性(用主机替换主机名)


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

我也对一个解决方案感兴趣-这里也有同样的问题。你是否有可能让服务坐在导致这种情况发生的负载平衡器后面?@DilipKrishnan这正是我所拥有的。我已使用SSL将ELB指向服务器。@DilipKrishnan-服务已部署到一个关键的Cloud Foundry实例。升级到springfox 2.6.1和spring 4.2+将解决此问题。最近刚刚使用了此方法。谢谢