问题描述
Springboot 集成swagger2时遇到的问题:
打开:http://localhost:8080/swagger-ui.html 报如下信息:
Unable to infer base url. This is common when using dynamic servlet
registration or when the API is behind an API Gateway. The base url is
the root of where all the swagger resources are served. For e.g. if
the api is available at http://example.org/api/v2/api-docs then the
base url is http://example.org/api/. Please enter the location
manually:
如图:
解决办法:
启动类(Application.java)加上 @EnableSwagger2 注解,如:
相关文章:
swagger2注解详解及案例:https://blog.csdn.net/qq_26482855/article/details/121511373