fix npe by MapSchema

This commit is contained in:
wing328 2018-04-04 23:02:13 +08:00
parent df19e1e05e
commit b8031b631d
44 changed files with 48 additions and 100 deletions

View File

@ -296,8 +296,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg
return getTypeDeclaration(inner) + "_Vectors.Vector";
}
if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
String name = getTypeDeclaration(inner) + "_Map";
if (name.startsWith("Swagger.")) {
return name;

View File

@ -783,8 +783,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
return getArrayTypeDeclaration((ArraySchema) p);
} else if (isMapSchema(p)) {
// Should we also support maps of maps?
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "<string, " + getTypeDeclaration(inner) + ">";
}
return super.getTypeDeclaration(p);

View File

@ -267,8 +267,7 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co
Schema inner = ap.getItems();
return "LIST [" + getTypeDeclaration(inner) + "]";
} else if (p instanceof MapSchema) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
}

View File

@ -229,9 +229,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
return "[]" + getTypeDeclaration(inner);
}
else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[string]" + getTypeDeclaration(inner);
}
//return super.getTypeDeclaration(p);

View File

@ -606,10 +606,9 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
}
return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
if (inner == null) {
LOGGER.warn(mp.getName() + "(map property) does not have a proper inner type defined. Default to string");
LOGGER.warn(p.getName() + "(map property) does not have a proper inner type defined. Default to string");
inner = new StringSchema().description("TODO default missing array inner type to string");
}
return getSchemaType(p) + "<String, " + getTypeDeclaration(inner) + ">";

View File

@ -264,8 +264,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
if (p instanceof ArraySchema) {
return getArrayTypeDeclaration((ArraySchema) p);
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
// Maps will be keyed only by primitive Kotlin string
return getSchemaType(p) + "<kotlin.String, " + getTypeDeclaration(inner) + ">";

View File

@ -309,8 +309,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
Schema inner = ap.getItems();
return getTypeDeclaration(inner) + "[]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]";
} else if (!StringUtils.isEmpty(p.get$ref())) { // model
String type = super.getTypeDeclaration(p);

View File

@ -161,8 +161,7 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen {
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[String, " + getTypeDeclaration(inner) + "]";
}
@ -187,8 +186,7 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen {
@Override
public String toInstantiationType(Schema p) {
if (p instanceof MapSchema) {
MapSchema ap = (MapSchema) p;
String inner = getSchemaType((Schema)ap.getAdditionalProperties());
String inner = getSchemaType((Schema)p.getAdditionalProperties());
return instantiationTypes.get("map") + "[String, " + inner + "]";
} else if (p instanceof ArraySchema) {
ArraySchema ap = (ArraySchema) p;

View File

@ -216,8 +216,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
Schema inner = ap.getItems();
return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return "{ [key: string]: " + getTypeDeclaration(inner) + "; }";
} else if (p instanceof FileSchema) {
return "any";
@ -237,8 +236,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
inner = mp1.getItems();
return this.getSchemaType(p) + "<" + this.getParameterDataType(parameter, inner) + ">";
} else if (p instanceof MapSchema) {
MapSchema mp = (MapSchema) p;
inner = (Schema) mp.getAdditionalProperties();
inner = (Schema) p.getAdditionalProperties();
return "{ [key: string]: " + this.getParameterDataType(parameter, inner) + "; }";
} else if (p instanceof StringSchema) {
// Handle string enums

View File

@ -172,8 +172,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
Schema inner = ap.getItems();
return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "<String, " + getTypeDeclaration(inner) + ">";
}

View File

@ -370,8 +370,7 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig {
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[String, " + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);

View File

@ -75,9 +75,7 @@ public class ConfluenceWikiCodegen extends DefaultCodegen implements CodegenConf
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[String, " + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);

View File

@ -266,8 +266,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">";
}
if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "<std::string, " + getTypeDeclaration(inner) + ">";
}
if (p instanceof StringSchema || p instanceof DateSchema

View File

@ -323,8 +323,7 @@ public class CppQt5ClientCodegen extends AbstractCppCodegen implements CodegenCo
}
return "0";
} else if (p instanceof MapSchema) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return "new QMap<QString, " + getTypeDeclaration(inner) + ">()";
} else if (p instanceof ArraySchema) {
ArraySchema ap = (ArraySchema) p;

View File

@ -281,8 +281,7 @@ public class CppRestClientCodegen extends AbstractCppCodegen {
return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">";
}
if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "<utility::string_t, " + getTypeDeclaration(inner) + ">";
}
if (p instanceof StringSchema || p instanceof DateSchema

View File

@ -291,8 +291,7 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
Schema inner = ap.getItems();
return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "<String, " + getTypeDeclaration(inner) + ">";
}

View File

@ -422,8 +422,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
Schema inner = ap.getItems();
return "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return "%{optional(String.t) => " + getTypeDeclaration(inner) + "}";
} else if (p instanceof PasswordSchema) {
return "String.t";

View File

@ -460,8 +460,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
Schema inner = ap.getItems();
return getTypeDeclaration(inner);
} else if (p instanceof MapSchema) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getTypeDeclaration(inner);
}
return super.getTypeDeclaration(p);

View File

@ -252,8 +252,7 @@ public class FinchServerCodegen extends DefaultCodegen implements CodegenConfig
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[String, " + getTypeDeclaration(inner) + "]";
}

View File

@ -532,8 +532,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
Schema inner = ap.getItems();
return "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return "(Map.Map String " + getTypeDeclaration(inner) + ")";
}
return super.getTypeDeclaration(p);

View File

@ -272,8 +272,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
Schema inner = ap.getItems();
return "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return "Map.Map String " + getTypeDeclaration(inner);
}
return fixModelChars(super.getTypeDeclaration(p));

View File

@ -162,8 +162,7 @@ public class JMeterCodegen extends DefaultCodegen implements CodegenConfig {
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[String, " + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);

View File

@ -563,8 +563,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
Schema inner = ap.getItems();
return "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return "{String: " + getTypeDeclaration(inner) + "}";
}
return super.getTypeDeclaration(p);

View File

@ -218,8 +218,7 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem
Schema inner = ap.getItems();
return getSchemaType(p) + "<!" + getTypeDeclaration(inner) + ">";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return "Object<!string, "+ getTypeDeclaration(inner) + ">";
} else if (p instanceof FileSchema) {
return "Object";

View File

@ -324,8 +324,7 @@ public class LuaClientCodegen extends DefaultCodegen implements CodegenConfig {
Schema inner = ap.getItems();
return getTypeDeclaration(inner);
} else if (p instanceof MapSchema) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getTypeDeclaration(inner);
}

View File

@ -360,8 +360,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
return getSchemaType(p) + "<" + innerTypeDeclaration + ">*";
}
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
String innerTypeDeclaration = getTypeDeclaration(inner);

View File

@ -211,8 +211,7 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);

View File

@ -139,8 +139,7 @@ public class PhpSilexServerCodegen extends DefaultCodegen implements CodegenConf
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);

View File

@ -144,8 +144,7 @@ public class PhpSlimServerCodegen extends DefaultCodegen implements CodegenConfi
Schema inner = ap.getItems();
return getTypeDeclaration(inner) + "[]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]";
} else if (!StringUtils.isEmpty(p.get$ref())) {
String type = super.getTypeDeclaration(p);

View File

@ -469,8 +469,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg
}
if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getTypeDeclaration(inner);
}

View File

@ -365,8 +365,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
Schema inner = ap.getItems();
return getTypeDeclaration(inner) + "[]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
// TODO not sure if the following map/hash declaration is correct
return "{String, " + getTypeDeclaration(inner) + "}";
} else if (!languageSpecificPrimitives.contains(getSchemaType(p))) {

View File

@ -362,8 +362,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "(str, " + getTypeDeclaration(inner) + ")";
}

View File

@ -274,9 +274,7 @@ public class PythonFlaskConnexionServerCodegen extends DefaultCodegen implements
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[str, " + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);

View File

@ -279,8 +279,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
Schema inner = ap.getItems();
return getTypeDeclaration(inner);
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getTypeDeclaration(inner);
}

View File

@ -205,8 +205,7 @@ public class RubyOnRailsServerCodegen extends DefaultCodegen implements CodegenC
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);

View File

@ -124,8 +124,7 @@ public class RubySinatraServerCodegen extends DefaultCodegen implements CodegenC
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);

View File

@ -282,8 +282,7 @@ public class RustClientCodegen extends DefaultCodegen implements CodegenConfig {
return "Vec<" + getTypeDeclaration(inner) + ">";
}
else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return "::std::collections::HashMap<String, " + getTypeDeclaration(inner) + ">";
}

View File

@ -698,8 +698,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig {
typeDeclaration.append(innerType).append(">");
return typeDeclaration.toString();
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
String innerType = getTypeDeclaration(inner);
StringBuilder typeDeclaration = new StringBuilder(typeMapping.get("map")).append("<").append(typeMapping.get("string")).append(", ");
if (!StringUtils.isEmpty(inner.get$ref())) {
@ -776,8 +775,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig {
Schema inner = ap.getItems();
return instantiationTypes.get("array") + "<" + getSchemaType(inner) + ">";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return instantiationTypes.get("map") + "<" + typeMapping.get("string") + ", " + getSchemaType(inner) + ">";
} else {
return null;

View File

@ -326,8 +326,7 @@ public class ScalaGatlingCodegen extends AbstractScalaCodegen implements Codegen
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[String, " + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);

View File

@ -110,9 +110,7 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[String, " + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);

View File

@ -100,9 +100,7 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig
Schema inner = ap.getItems();
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[String, " + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);

View File

@ -285,8 +285,7 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig {
Schema inner = ap.getItems();
return "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return "[String:" + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);

View File

@ -381,8 +381,7 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
Schema inner = ap.getItems();
return "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(prop)) {
MapSchema mp = (MapSchema) prop;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) prop.getAdditionalProperties();
return "[String:" + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(prop);

View File

@ -263,8 +263,7 @@ public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig
Schema inner = ap.getItems();
return "[" + getTypeDeclaration(inner) + "]";
} else if (isMapSchema(p)) {
MapSchema mp = (MapSchema) p;
Schema inner = (Schema) mp.getAdditionalProperties();
Schema inner = (Schema) p.getAdditionalProperties();
return "[String:" + getTypeDeclaration(inner) + "]";
}
return super.getTypeDeclaration(p);