0
votes

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?

1
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
Just a comment. For people using Spring Boot 2.3.x + Spring Cloud Hoxton + springdoc-openapi, my full resolved dependencies: gist.github.com/rekhubs/9a635927458cd5a1f243ed0536296673John Smith

1 Answers

2
votes

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.