spring boot 2.2 cannot serve swagger-resources when used with springdoc-openapi

雨燕双飞 提交于 2019-12-24 08:04:03

问题


https://www.dariawan.com/tutorials/spring/documenting-spring-boot-rest-api-springdoc-openapi-3/

According to this, using springdoc openapi dependencies should pull in swagger3

I am using

        <dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-ui</artifactId>
        <version>1.2.15</version>
    </dependency>
    <dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-webmvc-core</artifactId>
        <version>1.2.15</version>
    </dependency>

The swaggerui page looks for swagger-resouces which end in 404

MyErrorController.handleError:30 - ErrorController {timestamp=Wed Dec 11 13:56:37 CST 2019, status=404, error=Not Found, message=No message available, path=/swagger-resources}

I see these in dependencies

 +- org.springdoc:springdoc-openapi-ui:jar:1.2.15:compile
 |  +- org.webjars:swagger-ui:jar:3.24.0:compile
 |  \- org.webjars:webjars-locator:jar:0.37:compile
 |     \- org.webjars:webjars-locator-core:jar:0.41:compile
 |        +- io.github.classgraph:classgraph:jar:4.8.44:compile
 |        \- org.webjars.npm:angular__http:jar:2.4.10:compile
 +- org.springdoc:springdoc-openapi-webmvc-core:jar:1.2.15:compile
 |  \- org.springdoc:springdoc-openapi-common:jar:1.2.15:compile
 |     +- io.swagger.core.v3:swagger-models:jar:2.1.0:compile
 |     +- io.swagger.core.v3:swagger-annotations:jar:2.1.0:compile
 |     \- io.swagger.core.v3:swagger-integration:jar:2.1.0:compile
 |        \- io.swagger.core.v3:swagger-core:jar:2.1.0:compile
 |           \- javax.validation:validation-api:jar:2.0.1.Final:compile

来源:https://stackoverflow.com/questions/59293380/spring-boot-2-2-cannot-serve-swagger-resources-when-used-with-springdoc-openapi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!