[Spring] Support disabling ApiIgnore & Pageable imports#8421
[Spring] Support disabling ApiIgnore & Pageable imports#8421morphlne wants to merge 2 commits intoOpenAPITools:masterfrom
Conversation
|
@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) @nmuesch (2021/01) |
|
We shouldn't add 2 more options just to remove imports. I'd rather have only one option to completely add/remove the support for x-spring-paginated |
|
If it's considered to have only one option for config, may be better not use options at all and apply vendor extension... @borsch agree with you, it makes sense, will add new samples as modules |
6b8b6d1 to
3c4eade
Compare
3c4eade to
0d1c88f
Compare
|
Rebase on resolved blocker |
Merge branch 'master' of github.com:OpenAPITools/openapi-generator into fix_apiignore_and_pageable
|
Reworked - now one property Please review |
|
It would be great if this would be part of the 5.1 release. |
Unfortunatley, this fix is not part of 5.1.0 :-( |
|
This topic is still relevant and occurs in current version: openapi-generator-maven-plugin: 5.2.1 The class |
|
This PR is not merged. |
|
@wangq8 you can locally customize the template |
|
Hi @wangq8 , as I am not so familiar with the customization possibilities provided by openapi tool, I manipulate the source files right after its creation: Maybe this helps you, too |
|
Fixed in 5.3.0, working sample |
Issues
To fix #8360, #8192, #8916, #8776
Description
Support for vendor extension
x-spring-paginatedadded in #5022 provides non-configurable imports:Both imports appears even if
x-spring-paginatedis not specified. Those imports are undesirable cause they demand additional dependencies, otherwise compilation fails.Suggested fix
The PR adds config option for separately disabling imports
usePageable,useApiIgnore. Both options aretrueby default for backward compatibility.Alternative approach
On other hand, imports can be simple disabled using
{{vendorExtension.x-spring-paginated}}without new configs, but i believe, that generator behavior should depends on generator config, not on API description.Tests
Added generated samples with new config options
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master,5.1.x,6.0.x