swagger 的坑备忘录

1.生产环境通过访问前端swagger页面报错500 NumberFormatException: For input string: "80,80":(我用的ssagger版本是 2.6.1)

原因是版本低了,其中的HostNameProvider.class 引起的

 String port = request.getHeader("X-Forwarded-Port");

    if (hasText(port)) {
      builder.port(Integer.parseInt(port));
    }

版本换成 2.7.0就行了

我用的gradle ,改成如下就行了

    compile "io.springfox:springfox-swagger2:2.7.0"
    compile "io.springfox:springfox-swagger-ui:2.7.0" 

猜你喜欢

转载自blog.csdn.net/liaoxiaolin520/article/details/84338310