forked from loafle/openapi-generator-original
fix npe by MapSchema
This commit is contained in:
parent
df19e1e05e
commit
b8031b631d
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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) + "]";
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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) + ">";
|
||||
|
@ -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) + ">";
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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) + ">";
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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) + ">";
|
||||
}
|
||||
|
@ -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";
|
||||
|
@ -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);
|
||||
|
@ -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) + "]";
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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";
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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))) {
|
||||
|
@ -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) + ")";
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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) + ">";
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user