-
-
Notifications
You must be signed in to change notification settings - Fork 529
ClassNotFoundException: DefaultedPageable #729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Find class SpringDocDataRestConfiguration and overide it. package org.springdoc.data.rest; import com.querydsl.core.types.Predicate; import java.util.Optional; import static org.springdoc.core.Constants.SPRINGDOC_ENABLED; @configuration
} |
Adding dependency spring-boot-starter-data-rest seem to resolve the error.
Would be nice if springdoc would work without this dependency too. |
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/ Also, a fix will be added to handle this case, for projects relying on springdoc-openapi-data-rest for Pageable Support. |
Hi @bnasslahsen , thanks for solving the issue! What I did was, basically, remove the
Besides, in the controller endpoint that uses Pageable, I hidded the pageable parameter (because I didn't want it as request body) and added the
So far so good! But, just one question: in the documentation, it stated that
Do you have an example that uses Thanks! |
This is the sample code, you are looking for: |
Hey @bnasslahsen , After checking your example, I was able to use @ParameterObject to handle the However, in order to make it works, I needed to add back the dependency P.S. I still have But, I can stick to |
@ParameterObject is completly independent from org.springdoc:springdoc-openapi-data-rest:1.4.1. Why did you need back org.springdoc:springdoc-openapi-data-rest ? |
Here is my project: https://github.com/ivangfr/spring-cloud-stream-elasticsearch/tree/master/publisher-api In the
My
My enpoint
/v3/api-docs
It doesn't work if I change the endpoint configuration to
/v3/api-docs
|
It's working on your sample as well, using static {
SpringDocUtils.getConfig().replaceWithClass(org.springframework.data.domain.Pageable.class, org.springdoc.core.converters.models.Pageable.class);
} Let me know, if you made it work, so we can update the documentation accordingly. |
Hey @bnasslahsen ! Exactly, that was the problem! I've imported from By setting the Best |
Uh oh!
There was an error while loading. Please reload this page.
Hi, I have recently migrated my
springboot
(version 2.3.1) app fromspringfox
tospringdoc openapi
(version 1.4.1).The app uses
spring-boot-starter-data-elasticsearch
and has some endpoints that receivePageable
as parameters and return aPage
.I've added those 2 dependencies
I am getting an exception whose stacktrace is shown below. It's complaining that
org.springframework.data.rest.webmvc.support.DefaultedPageable
is missing.Thanks in advance!
The text was updated successfully, but these errors were encountered: