尝试使用 springfox 配置访问 swagger-ui.html 时出现 WhiteLabel 错误页面

ade*_*per 1 swagger spring-boot springfox

我正在尝试使用 Springfox 并遵循https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api文档从 springboot 项目生成 Swagger 文档。

最初,我收到错误“访问资源需要完全授权”,因为我在应用程序中使用 OAuth2。我更改了配置以允许所有以 /swagger-ui.html 结尾的请求。

现在,我在尝试访问本地的 /swagger-ui.html 时收到“WhiteLabel 错误页面 - 此应用程序没有 /error 的显式映射”。

我浏览了各种帖子,但没有一个解决方案对我有用 - 我没有使用可能干扰的@webmvcconfiguration。有人可以帮忙吗?

ace*_*ace 6

对于 Swagger 3.0,URL 更改为

http://localhost:8080/swagger-ui/index.html