-
-
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
[Java][Spring] Add Spring pagination with vendor extension x-spring-paginated #5022
[Java][Spring] Add Spring pagination with vendor extension x-spring-paginated #5022
Conversation
I executed the script ./bin/utils/ensure-up-to-date on my computer with no problem. The script showed “spring-all-petstore.sh successfully!”. But the check ci/circleci in the cloud showed the error “ERROR: Failed to run /home/circleci/OpenAPITools/openapi-generator/bin/spring-all-petstore.sh”. What is the reason for that? |
498265a
to
270cd37
Compare
@david1601 could you please rebase and run scripts? |
@david1601 @wing328 do you have any news on this PR? Is the merge planned anytime in the near future? |
43c5e20
to
b5bbeec
Compare
…ple at sample springboot-reactive
b5bbeec
to
78d7c41
Compare
…or-extension-x-spring-paginated * master: (29 commits) [Core, HTML2] Rendered docs are incomplete (OpenAPITools#7510) [C][Client]Support data callback function (OpenAPITools#7467) [typescript-axios] replace optional chaining (OpenAPITools#7476) [typescript-axios] fix refining `query` (OpenAPITools#7475) [powershell] Updated the Api doc with httpsiging script snippet. (OpenAPITools#7499) [go][client] Fix API docs example generation (OpenAPITools#7489) [ci][test] Fix samples (OpenAPITools#7509) [bug][Java] Honor instantiationMap for default values for array, map, set (OpenAPITools#4982) Fix stringifying of ~= (OpenAPITools#7460) minor formatting change (OpenAPITools#7503) [ruby] Fix generation when generateAliasAsModel is enabled (OpenAPITools#7419) [sonar][ci] Fixes some new recommended "bug" fixes found via Sonar (OpenAPITools#7508) Add option to set recursion limit (OpenAPITools#7491) regenerate java pkmst petstore samples (OpenAPITools#7502) fix issue without http signature auth (OpenAPITools#7504) [ruby] Support for per-operation servers (OpenAPITools#7415) Add a link to react native tutorial (OpenAPITools#7505) update of Objective-C model-body.mustache to support discriminator.mappedModels (OpenAPITools#7471) update samples [ci] Sonar bug fixes (OpenAPITools#7497) ...
So basically you've made everyone have to use Spring Data and Spring Fox. These are two big dependencies that have lots of transitive dependencies. You should not be forcing adding additional dependencies on people to satisfy a single use case. Please revert this. |
This breaks our build as well because we don't use neither spring-data (therefore not have Can we revert this or make it at least optional? |
I have the same problem @patst apart from that.... I dont want to add
because my app is not using JPA at all. my project: mercuriete/java-nurse-scheduling-problem#43 edited: i just added this:
and it works for me. |
Usually spring-data methods with Pageable support returns Page object. |
PR detail
By setting of x-spring-paginated: true for an operation in the yaml file at the same level as operationId this pull request add a Spring Pageable (org.springframework.data.domain.Pageable) parameter if JavaSpring is used.
The idea for the solution based on: swagger-api/swagger-codegen#3357.
Spring Pageable: https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/domain/Pageable.html
In yaml-file:
operationId: findPetsByTags
x-spring-paginated: true
Created PetApi.java:
PR checklist
Technical committee for programming language Java:
@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10)