swagger-gradle-codegen
swagger-gradle-codegen copied to clipboard
[Polymorphism Prep] Expose private KotlinGenerator methods in SharedCodegen
This PR does some preparatory work for #103 .
In order to achieve polymorphism support we need to extract few functionalities from KotlinGenerator
to SharedCodegen
.
I totally understand that this PR seems disconnected and doesn't really explain why certain features are moved back to SharedCodegen
or why we do even need to iterate over all CodegenModel.*vars
.
In order to provide a better visibility I would suggest to check the potential draft of polymorphism on macisamuele/swagger-gradle-codegen@maci-polymmorphism
I've rebased this branch on top of the laster master to remove the merge conflicts.
@cortinico could you please have a look to this CR?
This provides a starting point for for #103 and by itself does not provide any change that deserve a major release, so it could be merged even if we're not yet planning on having the 2.0.0 release
@cortinico it will take me some time (maybe a few weeks) to provide changes on this PR. Currently my laptop is not powerful enough to run all the tasks ;)
Maybe having also the second part will help understand some of the changes
The current branch that fully targets #103 is avaiblable on https://github.com/macisamuele/swagger-gradle-codegen/tree/maci-polymorphism .
@cortinico it will take me some time (maybe a few weeks) to provide changes on this PR. Currently my laptop is not powerful enough to run all the tasks ;)
No problem, let's keep this opened for now.
Codecov Report
Merging #104 (249f4d2) into master (5318347) will increase coverage by
1.81%
. The diff coverage is82.92%
.
:exclamation: Current head 249f4d2 differs from pull request most recent head cdd09a3. Consider uploading reports for the commit cdd09a3 to get more accurate results
@@ Coverage Diff @@
## master #104 +/- ##
============================================
+ Coverage 70.83% 72.65% +1.81%
- Complexity 138 147 +9
============================================
Files 11 12 +1
Lines 576 607 +31
Branches 87 80 -7
============================================
+ Hits 408 441 +33
- Misses 118 122 +4
+ Partials 50 44 -6
Impacted Files | Coverage Δ | |
---|---|---|
.../src/main/java/com/yelp/codegen/KotlinGenerator.kt | 83.62% <ø> (+0.83%) |
:arrow_up: |
...in/src/main/java/com/yelp/codegen/SharedCodegen.kt | 63.93% <77.41%> (+6.14%) |
:arrow_up: |
...ain/java/com/yelp/codegen/utils/CodegenModelVar.kt | 100.00% <100.00%> (ø) |
|
...ugin/plugin/src/main/java/com/yelp/codegen/Main.kt | 98.33% <0.00%> (-0.06%) |
:arrow_down: |
...rc/main/java/com/yelp/codegen/utils/StringUtils.kt | 100.00% <0.00%> (+11.11%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 5318347...cdd09a3. Read the comment docs.