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?

2
  • 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? Commented Jun 12, 2020 at 16:36
  • Just a comment. For people using Spring Boot 2.3.x + Spring Cloud Hoxton + springdoc-openapi, my full resolved dependencies: gist.github.com/rekhubs/9a635927458cd5a1f243ed0536296673 Commented Sep 17, 2020 at 4:45

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.