-
-
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 fix: Kotlin generator doesn't support inheritance #1026
Conversation
49303f6
to
45a1cd6
Compare
LGTM: @jimschubert any thoughts? |
@@ -498,4 +502,16 @@ public void execute(Template.Fragment fragment, Writer writer) throws IOExceptio | |||
writer.write(fragment.execute().replaceAll(from, to)); | |||
} | |||
} | |||
|
|||
// Can't figure out the logic in DefaultCodegen but optional vars are getting duplicated when there's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed with you it should be done in DefautlCodegen. I'll try to figure out a fix later in DefaultCodegen so as to fix the issue for other generators as well.
Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors. Let me know if you need help fixing it. |
Current master is 3.3.0 as we merged 3.3.x into master previously to prepare for the release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but would recommend fixing the commit authorship before merging.
* allVars is duplicating child preoperties when models are inherited. Filter out these duplicates in the KotlinSpringServerCodegen * isInherited property was not being populated in the CodegenModel, re-parse the models in the KotlinSpringServerCodegen class and populate the property here * Add template support for Kotlin models which require inheritance from a base class to support oneOf declarations in the api yaml * Change optional for parameters to use Kotlins nullable * Update petstore api with Optional -> Nullable
45a1cd6
to
4042706
Compare
Cheers @wing328, changed the git author now... |
…s#1026) * allVars is duplicating child preoperties when models are inherited. Filter out these duplicates in the KotlinSpringServerCodegen * isInherited property was not being populated in the CodegenModel, re-parse the models in the KotlinSpringServerCodegen class and populate the property here * Add template support for Kotlin models which require inheritance from a base class to support oneOf declarations in the api yaml * Change optional for parameters to use Kotlins nullable * Update petstore api with Optional -> Nullable
@irishshagua thanks again for the PR, which is included in the v3.3.0 minor release: https://twitter.com/oas_generator/status/1046941449609068544 |
…s#1026) * allVars is duplicating child preoperties when models are inherited. Filter out these duplicates in the KotlinSpringServerCodegen * isInherited property was not being populated in the CodegenModel, re-parse the models in the KotlinSpringServerCodegen class and populate the property here * Add template support for Kotlin models which require inheritance from a base class to support oneOf declarations in the api yaml * Change optional for parameters to use Kotlins nullable * Update petstore api with Optional -> Nullable
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,3.3.x
,4.0.x
. Default:master
.@jimschubert @dr4ke616
Description of the PR
Kinda fix for Issue 1025