Skip to content

Commit

Permalink
[KOTLIN][CLIENT] fix unused library additional properties on kotlin…
Browse files Browse the repository at this point in the history
… generator (#11328)

* fix `library` additional properties on kotlin generator

* remove duplicated codes in kotlin generators
  • Loading branch information
anantadwi13 authored Jan 16, 2022
1 parent 070f767 commit c7d9f57
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@ public void processOpts() {
additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel);
}

if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) {
this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY));
}

if (additionalProperties.containsKey(CodegenConstants.PARCELIZE_MODELS)) {
this.setParcelizeModels(convertPropertyToBooleanAndWriteBack(CodegenConstants.PARCELIZE_MODELS));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@ public CodegenType getTag() {
public void processOpts() {
super.processOpts();

if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) {
this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY));
}

// set default library to "ktor"
if (StringUtils.isEmpty(library)) {
this.setLibrary(DEFAULT_LIBRARY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,6 @@ public CodegenType getTag() {
public void processOpts() {
super.processOpts();

if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) {
this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY));
}

// set default library to "ktor"
if (StringUtils.isEmpty(library)) {
this.setLibrary(DEFAULT_LIBRARY);
Expand Down

0 comments on commit c7d9f57

Please sign in to comment.