-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[BUG][JAVA] Uses spring pageable without any config indicating to do so #13052
Comments
Bump, this is not a big issue but it is documented nowhere and randomly breaks stuff, not very funny. |
@downloadpizza it looks like you can try this workaround with little tweak in your schema (replaced ref with type for Pageable): components:
schemas:
Pageable:
type: object
properties:
definetly_not_pageable:
type: string
PagedObject:
type: object
properties:
value:
type: string
pageable:
type: pageable btw, I see two possible fixes: b) make all that importMapping thing customizable, using putIfAbsent(), then you could have used workaround by setting |
@Mintas regarding your suggested fix: the |
@Mintas sorry, my fault. now I understand what you meant! |
While I am not working on the project where this was an issue anymore. Your solution helped me on something completely unrelated. Thanks! |
) * spring: fix spring pageable used without any config Spring Pageable is imported whenever we have an API with a Pageable Json schema, even if x-spring-paginated is not set. This commit imports Spring Pageable only if x-spring-paginated is set to true. * spring: add unit test for pageable fix * spring: fix spring pageable feedback from review remove unrelated example --------- Co-authored-by: gonzalad <gonzalad@users.noreply.github.com>
Bug Report Checklist
Description
Using any schema called Pageable will instead use springs pageable (in a spring project)
openapi-generator version
6.0.1
OpenAPI declaration file content or url
https://github.com/downloadpizza/spring-openapi-pageable-poc
Generation Details
refer to pom.xml in my project
Steps to reproduce
Related issues/PRs
#8360
Suggest a fix
redo the entire Pageable and springfox thing. #8192 (comment) as this user has said (which I agree with) it is a dumb thing for a mature library. Its a random very intrusive change that benefits very few people.
The text was updated successfully, but these errors were encountered: