diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index 74b235f1e73d..56808a6efbde 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -781,7 +781,7 @@ public String toInstantiationType(Schema p) { public String getTypeDeclaration(Schema p) { if (p instanceof ArraySchema) { return getArrayTypeDeclaration((ArraySchema) p); - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { // Should we also support maps of maps? MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index 774c4eab1934..32315bc64756 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -228,7 +228,7 @@ public String getTypeDeclaration(Schema p) { Schema inner = ap.getItems(); return "[]" + getTypeDeclaration(inner); } - else if (p instanceof MapSchema) { + else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index 7095ffad6ad6..7e9d09a69f81 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -263,7 +263,7 @@ public String getSchemaType(Schema p) { public String getTypeDeclaration(Schema p) { if (p instanceof ArraySchema) { return getArrayTypeDeclaration((ArraySchema) p); - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java index c9ac464189bc..722522b5472c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java @@ -308,7 +308,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getTypeDeclaration(inner) + "[]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java index ae1a2532c64f..cebd7b42be59 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java @@ -160,7 +160,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 23ad7b8d8a9e..a1b15145e099 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -215,7 +215,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return "{ [key: string]: " + getTypeDeclaration(inner) + "; }"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AkkaScalaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AkkaScalaClientCodegen.java index 582b37374691..699f31706bce 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AkkaScalaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AkkaScalaClientCodegen.java @@ -258,7 +258,7 @@ public String toDefaultValue(Schema p) { return "null"; } else if (p instanceof IntegerSchema) { return "null"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema ap = (MapSchema) p; String inner = getSchemaType((Schema) ap.getAdditionalProperties()); return "Map[String, " + inner + "].empty "; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java index 36b1458b833d..95c103c10425 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java @@ -171,7 +171,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java index 86c7c669403a..addd3d1bfceb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java @@ -370,7 +370,7 @@ public String getTypeDeclaration(Schema p) { Schema inner = ap.getItems(); return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]"; } - else if (p instanceof MapSchema) { + else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return getSchemaType(p) + "[String, " + getTypeDeclaration(inner) + "]"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java index a971b7172ff2..db819fe74ed0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java @@ -74,7 +74,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java index 0b576656c327..81e4aafdafae 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java @@ -265,7 +265,7 @@ public String getTypeDeclaration(Schema p) { Schema inner = ap.getItems(); return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">"; } - if (p instanceof MapSchema) { + if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return getSchemaType(p) + ""; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java index 30ce574ab2d4..b4da078482c9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java @@ -288,7 +288,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">*"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return getSchemaType(p) + "*"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestClientCodegen.java index e7f6cb291493..5fa6b0760dc2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestClientCodegen.java @@ -280,7 +280,7 @@ public String getTypeDeclaration(Schema p) { Schema inner = ap.getItems(); return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">"; } - if (p instanceof MapSchema) { + if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return getSchemaType(p) + ""; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java index d0f0a9ff8d98..30d817a4e4e9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java @@ -268,7 +268,7 @@ public String getTypeDeclaration(Schema p) { Schema inner = ap.getItems(); return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">"; } - if (p instanceof MapSchema) { + if (isMapSchema(p)) { Schema inner = (Schema) p.getAdditionalProperties(); return getSchemaType(p) + ""; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java index a39651244dc4..ec671d4dfa89 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java @@ -276,7 +276,7 @@ public String toApiFilename(String name) { @Override public String toDefaultValue(Schema p) { - if (p instanceof MapSchema) { + if (isMapSchema(p)) { return "{}"; } else if (p instanceof ArraySchema) { return "[]"; @@ -290,7 +290,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java index 164074429ea0..68666561c9a0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java @@ -421,7 +421,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return "%{optional(String.t) => " + getTypeDeclaration(inner) + "}"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index 7f67cb005c65..3a67f6a84919 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -531,7 +531,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return "(Map.Map String " + getTypeDeclaration(inner) + ")"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java index 6ddcece0c275..47bfcaaa7c56 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java @@ -271,7 +271,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return "Map.Map String " + getTypeDeclaration(inner); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java index 6377ffd6b2e8..2b0d1a9f1629 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java @@ -562,7 +562,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return "{String: " + getTypeDeclaration(inner) + "}"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java index 68b032d0d8c4..65035363e9a6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java @@ -359,7 +359,7 @@ public String getTypeDeclaration(Schema p) { } return getSchemaType(p) + "<" + innerTypeDeclaration + ">*"; } - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java index 74c22ce9a988..8bd6c74654c5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java @@ -210,7 +210,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java index 7c4741e45ad8..7f589209b8b5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java @@ -138,7 +138,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java index 6d0a195693c2..65209640981f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java @@ -143,7 +143,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getTypeDeclaration(inner) + "[]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java index 45bcdaf74f79..2d6b277d04e6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java @@ -468,7 +468,7 @@ public String getTypeDeclaration(Schema p) { return getTypeDeclaration(inner); } - if (p instanceof MapSchema) { + if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return getTypeDeclaration(inner); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java index 1a9c4af880f0..af011abcd618 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java @@ -364,7 +364,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getTypeDeclaration(inner) + "[]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); // TODO not sure if the following map/hash declaration is correct diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 2a68c2c57018..3c245c6cce3a 100755 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -361,7 +361,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java index 7007ed0cf210..97337b2507c8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java @@ -273,7 +273,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java index 726ad5f43e54..30316cf25086 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java @@ -278,7 +278,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getTypeDeclaration(inner); - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return getTypeDeclaration(inner); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 0ccca609a727..23004861fead 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -376,7 +376,7 @@ public String getTypeDeclaration(Schema schema) { if (schema instanceof ArraySchema) { Schema inner = ((ArraySchema) schema).getItems(); return String.format("%s[%s]", getSchemaType(schema), getTypeDeclaration(inner)); - } else if (schema instanceof MapSchema) { + } else if (isMapSchema(schema)) { Schema inner = (Schema) schema.getAdditionalProperties(); return String.format("%s[String, %s]", getSchemaType(schema), getTypeDeclaration(inner)); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java index 80818db01c50..2ae7ec18e49f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java @@ -204,7 +204,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubySinatraServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubySinatraServerCodegen.java index ff9c79396573..e24ade225e3c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubySinatraServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubySinatraServerCodegen.java @@ -123,7 +123,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java index 8cd4a0d15768..9fa12d2b4a52 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java @@ -284,7 +284,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return "[String:" + getTypeDeclaration(inner) + "]"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java index 339a537a784c..7a1f7819b389 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java @@ -380,7 +380,7 @@ public String getTypeDeclaration(Schema prop) { ArraySchema ap = (ArraySchema) prop; Schema inner = ap.getItems(); return "[" + getTypeDeclaration(inner) + "]"; - } else if (prop instanceof MapSchema) { + } else if (isMapSchema(prop)) { MapSchema mp = (MapSchema) prop; Schema inner = (Schema) mp.getAdditionalProperties(); return "[String:" + getTypeDeclaration(inner) + "]"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java index 29a35d04cfd1..0bed035c5e52 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java @@ -262,7 +262,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { MapSchema mp = (MapSchema) p; Schema inner = (Schema) mp.getAdditionalProperties(); return "[String:" + getTypeDeclaration(inner) + "]"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index 2e4eff4e388b..b223a3bf45b4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -100,7 +100,7 @@ public String getTypeDeclaration(Schema p) { if (p instanceof ArraySchema) { inner = ((ArraySchema) p).getItems(); return this.getSchemaType(p) + "<" + this.getTypeDeclaration(inner) + ">"; - } else if (p instanceof MapSchema) { + } else if (isMapSchema(p)) { inner = (Schema) p.getAdditionalProperties(); return "{ [key: string]: " + this.getTypeDeclaration(inner) + "; }"; } else if (p instanceof FileSchema) {