首页 > 解决方案 > swagger-ui.html 在 Vaadin + Spring 应用程序中显示空白页面

问题描述

在我的 Spring+Vaadin (18) 应用程序中,我配置了这个:

vaadin.url-mapping=/ui/*

所有 Vaadin 视图都可以通过“localhost:8080/ui/something”地址访问。

在 pom 中,我有 Swagger UI 所需的依赖项:

<dependency>
    <groupId>org.springdoc</groupId>
    <artifactId>springdoc-openapi-ui</artifactId>
    <version>${springdoc.version}</version>
</dependency>

但是 swagger-ui 页面通过浏览到 http://localhost:8080/swagger-ui.html 会返回完整的空白,并显示以下控制台输出,它会自动重定向到 http://localhost:8080/swagger-ui/index.html/ ?configUrl=/v3/api-docs/swagger-config。

在此处输入图像描述

OpenAPI JSON 页面可在 http://localhost:8080/v3/api-docs/ 上访问

在此处输入图像描述

知道为什么不显示 Swagger UI 页面吗?

标签: javaspringswaggervaadin

解决方案


推荐阅读