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

0

1

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
Liquidator answered 11/12, 2019 at 20:13 Comment(5)
springdoc-openapi does not serve any /swagger-resources endpoint, I confirm...Moloch
which jars is it supposed to come from?Liquidator
also this is relevant if you directly try to use springfox github.com/springfox/springfox/issues/2932Liquidator
I think SpringFox added their own way to list all services you want with the /swagger-resources endpoint. But not SpringDoc... You have to do it yourselfMoloch
but how do I do that?Liquidator

© 2022 - 2024 — McMap. All rights reserved.