This commit is contained in:
William Cheng 2022-01-16 18:10:51 +08:00
commit 156868e407
3 changed files with 4 additions and 8 deletions

View File

@ -475,6 +475,10 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel); additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel);
} }
if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) {
this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY));
}
if (additionalProperties.containsKey(CodegenConstants.PARCELIZE_MODELS)) { if (additionalProperties.containsKey(CodegenConstants.PARCELIZE_MODELS)) {
this.setParcelizeModels(convertPropertyToBooleanAndWriteBack(CodegenConstants.PARCELIZE_MODELS)); this.setParcelizeModels(convertPropertyToBooleanAndWriteBack(CodegenConstants.PARCELIZE_MODELS));
} else { } else {

View File

@ -191,10 +191,6 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen {
public void processOpts() { public void processOpts() {
super.processOpts(); super.processOpts();
if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) {
this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY));
}
// set default library to "ktor" // set default library to "ktor"
if (StringUtils.isEmpty(library)) { if (StringUtils.isEmpty(library)) {
this.setLibrary(DEFAULT_LIBRARY); this.setLibrary(DEFAULT_LIBRARY);

View File

@ -175,10 +175,6 @@ public class KotlinServerDeprecatedCodegen extends AbstractKotlinCodegen {
public void processOpts() { public void processOpts() {
super.processOpts(); super.processOpts();
if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) {
this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY));
}
// set default library to "ktor" // set default library to "ktor"
if (StringUtils.isEmpty(library)) { if (StringUtils.isEmpty(library)) {
this.setLibrary(DEFAULT_LIBRARY); this.setLibrary(DEFAULT_LIBRARY);