Removed tabs in TypeScriptClientCodegen

This commit is contained in:
Tino Fuhrmann 2019-05-05 20:43:50 +02:00
parent 6c37c7180d
commit 9297e59053

View File

@ -135,8 +135,8 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo
CliOption frameworkOption = new CliOption(TypeScriptClientCodegen.FRAMEWORK_SWITCH, TypeScriptClientCodegen.FRAMEWORK_SWITCH_DESC); CliOption frameworkOption = new CliOption(TypeScriptClientCodegen.FRAMEWORK_SWITCH, TypeScriptClientCodegen.FRAMEWORK_SWITCH_DESC);
for (String option: TypeScriptClientCodegen.FRAMEWORKS) { for (String option: TypeScriptClientCodegen.FRAMEWORKS) {
// TODO: improve description? // TODO: improve description?
frameworkOption.addEnum(option, option); frameworkOption.addEnum(option, option);
} }
frameworkOption.defaultValue(FRAMEWORKS[0]); frameworkOption.defaultValue(FRAMEWORKS[0]);
System.out.println("Added framework option"); System.out.println("Added framework option");
@ -189,14 +189,14 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo
@Override @Override
public Map<String, Object> postProcessSupportingFileData(Map<String, Object> objs) { public Map<String, Object> postProcessSupportingFileData(Map<String, Object> objs) {
Map<String, Boolean> frameworks = new HashMap<>(); Map<String, Boolean> frameworks = new HashMap<>();
for (String framework: FRAMEWORKS) { for (String framework: FRAMEWORKS) {
frameworks.put(framework, framework.equals(additionalProperties.get(FRAMEWORK_SWITCH))); frameworks.put(framework, framework.equals(additionalProperties.get(FRAMEWORK_SWITCH)));
} }
objs.put("framework", additionalProperties.get(FRAMEWORK_SWITCH)); objs.put("framework", additionalProperties.get(FRAMEWORK_SWITCH));
objs.put("frameworks", frameworks); objs.put("frameworks", frameworks);
objs.put("fileContentDataType", additionalProperties.get(FILE_CONTENT_DATA_TYPE)); objs.put("fileContentDataType", additionalProperties.get(FILE_CONTENT_DATA_TYPE));
return objs; return objs;
} }
@ -713,7 +713,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo
if (additionalProperties.containsKey(FRAMEWORK_SWITCH)) { if (additionalProperties.containsKey(FRAMEWORK_SWITCH)) {
supportingFiles.add(new SupportingFile("generators/" + additionalProperties.get(FRAMEWORK_SWITCH) + ".mustache", "index.ts")); supportingFiles.add(new SupportingFile("generators/" + additionalProperties.get(FRAMEWORK_SWITCH) + ".mustache", "index.ts"));
} else { } else {
additionalProperties.put(FRAMEWORK_SWITCH, FRAMEWORKS[0]); additionalProperties.put(FRAMEWORK_SWITCH, FRAMEWORKS[0]);
supportingFiles.add(new SupportingFile("generators" + File.separator + FRAMEWORKS[0] + ".mustache", "index.ts")); supportingFiles.add(new SupportingFile("generators" + File.separator + FRAMEWORKS[0] + ".mustache", "index.ts"));
} }
String httpLibName = this.getHttpLibForFramework(additionalProperties.get(FRAMEWORK_SWITCH).toString()); String httpLibName = this.getHttpLibForFramework(additionalProperties.get(FRAMEWORK_SWITCH).toString());
@ -721,11 +721,11 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo
} }
private String getHttpLibForFramework(String object) { private String getHttpLibForFramework(String object) {
return this.frameworkToHttpLibMap.get(object); return this.frameworkToHttpLibMap.get(object);
} }
@Override @Override
public String getTypeDeclaration(Schema p) { public String getTypeDeclaration(Schema p) {
Schema inner; Schema inner;
if (ModelUtils.isArraySchema(p)) { if (ModelUtils.isArraySchema(p)) {