forked from loafle/openapi-generator-original
[KOTLIN][CLIENT] fix unused library
additional properties on kotlin generator (#11328)
* fix `library` additional properties on kotlin generator * remove duplicated codes in kotlin generators
This commit is contained in:
parent
070f767d80
commit
c7d9f5788d
@ -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 {
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user