Introduce Decoders class

This commit is contained in:
kubo_takaichi
2015-05-18 17:26:41 +09:00
parent be7fccce68
commit bb3ec04ed1
9 changed files with 71 additions and 164 deletions

View File

@@ -63,8 +63,6 @@ public class SwiftGenerator extends DefaultCodegen implements CodegenConfig {
supportingFiles.add(new SupportingFile("Extensions.mustache", sourceFolder, "Extensions.swift"));
supportingFiles.add(new SupportingFile("Models.mustache", sourceFolder, "Models.swift"));
supportingFiles.add(new SupportingFile("APIs.mustache", sourceFolder, "APIs.swift"));
supportingFiles.add(new SupportingFile("DecodableDictionary.mustache", sourceFolder, "DecodableDictionary.swift"));
supportingFiles.add(new SupportingFile("DecodableArray.mustache", sourceFolder, "DecodableArray.swift"));
languageSpecificPrimitives = new HashSet<String>(
Arrays.asList(
@@ -140,11 +138,11 @@ public class SwiftGenerator extends DefaultCodegen implements CodegenConfig {
if (p instanceof ArrayProperty) {
ArrayProperty ap = (ArrayProperty) p;
Property inner = ap.getItems();
return "DecodableArray<" + getTypeDeclaration(inner) + ">";
return "[" + getTypeDeclaration(inner) + "]";
} else if (p instanceof MapProperty) {
MapProperty mp = (MapProperty) p;
Property inner = mp.getAdditionalProperties();
return "DecodableDictionary<String, " + getTypeDeclaration(inner) + ">";
return "[String:" + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);
}