0

After migration of Spring Boot to version 3.1 and springdoc-openapi libraries to 1.4.1:

  • springdoc-openapi-ui
  • springdoc-openapi-security
  • springdoc-openapi-data-rest

I faced issue ClassNotFoundException: org.springframework.data.rest.webmvc.support.DefaultedPageable

Also now on Swagger UI page controllers and schemas for @Entity are generated, however earlier there were only endpoints from @RestController, request and response DTOs. Are there any way to disable it?

fjsv
  • 705
  • 10
  • 23
  • This seems like a dependency issue. Can you share your dependencies? Are you using Maven or Gradle? Where does that error appear? compiling or starting the app? – fjsv Jun 12 '20 at 16:36
  • Just a comment. For people using `Spring Boot 2.3.x` + `Spring Cloud Hoxton` + `springdoc-openapi`, my full resolved dependencies: https://gist.github.com/rekhubs/9a635927458cd5a1f243ed0536296673 – John Smith Sep 17 '20 at 04:45

1 Answers1

2

From your description, you don't need to load springdoc-openapi-data-rest. (You will load unecessary beans related to spring-data-rest)

If you just need to enable the support of Pageable, you can just add the following line:

SpringDocUtils.getConfig().replaceWithClass(org.springframework.data.domain.Pageable.class, Pageable.class);

This is explained here: https://springdoc.org/ Section [Spring Data Rest support]

Or, if you want to depend on spring-boot-starter-data-rest, then add the dependency.

brianbro
  • 4,141
  • 2
  • 24
  • 37
  • Just simple notice for others - it requires `springdoc-openapi-ui` version >=1.6.6. Because in version 1.2.30 `SpringDocUtils` class doesn't exist – xardbaiz Feb 10 '22 at 09:26