Ruslan Kharevych
Ruslan Kharevych

Reputation: 3

Springdoc-openapi. ClassNotFoundException: org.springframework.data.rest.webmvc.support.DefaultedPageable

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

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?

Upvotes: 0

Views: 5178

Answers (1)

brianbro
brianbro

Reputation: 4769

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.

Upvotes: 2

Related Questions