OpenAPITools / OpenAPITools/openapi-generator
[REQ] [Java][Spring] Return 'Page<Model>' instead of 'List<Model>' when using 'x-spring-paginated'
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
When using Spring Data Pageable in classes generated with the Spring generator and x-spring-paginated: true I would expect the return type to be Page<Model> instead of List<Model>.
Describe the solution you'd like
The Spring generator should return Page<Model> instead of List<Model> when using x-spring-paginated: true.
This has also been requested by @amelnikoff at https://github.com/OpenAPITools/openapi-generator/issues/8315#issuecomment-797010332
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Spring generator code that handles x-spring-paginated and any tests covering generated paginated methods. The change is complete when that flag produces Page return types instead of List, while other return types remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100