mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 10:58:55 +00:00
parent
b54bd0581a
commit
a2a7ffe2bd
@ -149,6 +149,7 @@ public class KotlinClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
importMapping.put("LocalTime", "java.time.LocalTime");
|
importMapping.put("LocalTime", "java.time.LocalTime");
|
||||||
|
|
||||||
cliOptions.clear();
|
cliOptions.clear();
|
||||||
|
cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC).defaultValue(sourceFolder));
|
||||||
cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Client package name (e.g. io.swagger).").defaultValue(this.packageName));
|
cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Client package name (e.g. io.swagger).").defaultValue(this.packageName));
|
||||||
cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, "Client package's organization (i.e. maven groupId).").defaultValue(groupId));
|
cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, "Client package's organization (i.e. maven groupId).").defaultValue(groupId));
|
||||||
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, "Client artifact id (name of generated jar).").defaultValue(artifactId));
|
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, "Client artifact id (name of generated jar).").defaultValue(artifactId));
|
||||||
@ -191,6 +192,12 @@ public class KotlinClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
public void processOpts() {
|
public void processOpts() {
|
||||||
super.processOpts();
|
super.processOpts();
|
||||||
|
|
||||||
|
if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) {
|
||||||
|
this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER));
|
||||||
|
} else {
|
||||||
|
additionalProperties.put(CodegenConstants.SOURCE_FOLDER, sourceFolder);
|
||||||
|
}
|
||||||
|
|
||||||
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
|
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
|
||||||
this.setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
|
this.setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
|
||||||
} else {
|
} else {
|
||||||
|
@ -34,6 +34,8 @@ public class KotlinClientCodegenOptionsTest extends AbstractOptionsTest {
|
|||||||
times = 1;
|
times = 1;
|
||||||
codegen.setGroupId(KotlinClientCodegenOptionsProvider.GROUP_ID);
|
codegen.setGroupId(KotlinClientCodegenOptionsProvider.GROUP_ID);
|
||||||
times = 1;
|
times = 1;
|
||||||
|
codegen.setSourceFolder(KotlinClientCodegenOptionsProvider.SOURCE_FOLDER);
|
||||||
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ public class KotlinClientCodegenOptionsProvider implements OptionsProvider {
|
|||||||
public static final String ARTIFACT_VERSION_VALUE = "0.0.1-SNAPSHOT";
|
public static final String ARTIFACT_VERSION_VALUE = "0.0.1-SNAPSHOT";
|
||||||
public static final String ARTIFACT_ID = "swagger-kotlin-test";
|
public static final String ARTIFACT_ID = "swagger-kotlin-test";
|
||||||
public static final String GROUP_ID = "io.swagger.tests";
|
public static final String GROUP_ID = "io.swagger.tests";
|
||||||
|
public static final String SOURCE_FOLDER = "./generated/kotlin";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getLanguage() {
|
public String getLanguage() {
|
||||||
@ -25,6 +26,7 @@ public class KotlinClientCodegenOptionsProvider implements OptionsProvider {
|
|||||||
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
||||||
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID)
|
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID)
|
||||||
.put(CodegenConstants.GROUP_ID, GROUP_ID)
|
.put(CodegenConstants.GROUP_ID, GROUP_ID)
|
||||||
|
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user