Home > Mobile >  Spring Boot 3.0.0 and Springdoc incompatible?
Spring Boot 3.0.0 and Springdoc incompatible?

Time:12-16

I have a barebones SpringBoot project, with the latest Springdoc dependency (as of this writing) in the pom file:

<dependency>
    <groupId>org.springdoc</groupId>
    <artifactId>springdoc-openapi-ui</artifactId>
    <version>1.6.13</version>
</dependency>

In addition I only have the web starter dependency:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

It works fine with Spring Boot 2.7.5. On local machine, I can go to http://localhost:8080/swagger-ui.html and http://localhost:8080/v3/api-docs and be redirected to the OpenAPI resources. However, once I change Spring Boot version to 3.0.0 and restart the application, I only get 404 NOT FOUND on the above two resources.

Has anyone found a way to make this work with Spring Boot 3.0.0?

CodePudding user response:

You must use SpringDoc 2

https://springdoc.org/v2/

<dependency>
  <groupId>org.springdoc</groupId>
  <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
  <version>2.0.0</version>
</dependency>

CodePudding user response:

Only springdoc 2.0.0 is compatible with Spring Boot 3.0.0. Check the release here --> https://github.com/springdoc/springdoc-openapi/releases/tag/v2.0.0.

  • Related