diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Unity3DCsharpDotNet2ClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Unity3DCsharpDotNet2ClientCodegen.java index 66591eacac2..2a0aa006674 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Unity3DCsharpDotNet2ClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Unity3DCsharpDotNet2ClientCodegen.java @@ -101,8 +101,12 @@ public class Unity3DCsharpDotNet2ClientCodegen extends DefaultCodegen implements additionalProperties.put("packageName", packageName); } - additionalProperties.put("clientPackage", clientPackage); - + if (additionalProperties.containsKey("clientPackage")) { + this.setClientPackage((String) additionalProperties.get("clientPackage")); + } else { + additionalProperties.put("clientPackage", clientPackage); + } + supportingFiles.add(new SupportingFile("Configuration.mustache", (sourceFolder + File.separator + clientPackage).replace(".", java.io.File.separator), "Configuration.cs")); supportingFiles.add(new SupportingFile("ApiClient.mustache", @@ -110,12 +114,15 @@ public class Unity3DCsharpDotNet2ClientCodegen extends DefaultCodegen implements supportingFiles.add(new SupportingFile("ApiException.mustache", (sourceFolder + File.separator + clientPackage).replace(".", java.io.File.separator), "ApiException.cs")); supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor", "packages.config")); - supportingFiles.add(new SupportingFile("compile.mustache", "", "compile.bat")); supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh")); supportingFiles.add(new SupportingFile("README.md", "", "README.md")); } + public void setClientPackage(String clientPackage) { + this.clientPackage = clientPackage; + } + public CodegenType getTag() { return CodegenType.CLIENT; } diff --git a/modules/swagger-codegen/src/main/resources/Unity3DCsharpDotNet2/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Unity3DCsharpDotNet2/ApiClient.mustache index ba4fdcf3c00..8e64db5af31 100644 --- a/modules/swagger-codegen/src/main/resources/Unity3DCsharpDotNet2/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Unity3DCsharpDotNet2/ApiClient.mustache @@ -145,7 +145,7 @@ namespace {{packageName}}.Client if (obj is DateTime) return ((DateTime)obj).ToString ("u"); else if (obj is List) - return String.Join(",", obj as List); + return String.Join(",", (obj as List).ToArray()); else return Convert.ToString (obj); } diff --git a/modules/swagger-codegen/src/main/resources/Unity3DCsharpDotNet2/compile-mono.sh.mustache b/modules/swagger-codegen/src/main/resources/Unity3DCsharpDotNet2/compile-mono.sh.mustache index 499b42a29a5..69c9bb8b2fd 100644 --- a/modules/swagger-codegen/src/main/resources/Unity3DCsharpDotNet2/compile-mono.sh.mustache +++ b/modules/swagger-codegen/src/main/resources/Unity3DCsharpDotNet2/compile-mono.sh.mustache @@ -2,7 +2,7 @@ wget -nc https://nuget.org/nuget.exe; mozroots --import --sync mono nuget.exe install vendor/packages.config -o vendor; mkdir -p bin; -mcs -r:vendor/Newtonsoft.Json.7.0.1/lib/net20/Newtonsoft.Json.dll,\ +mcs -sdk:2 -r:vendor/Newtonsoft.Json.7.0.1/lib/net20/Newtonsoft.Json.dll,\ vendor/RestSharp.Net2.1.1.11/lib/net20/RestSharp.Net2.dll,\ System.Runtime.Serialization.dll \ -target:library \ diff --git a/modules/swagger-codegen/src/main/resources/csharp/Newtonsoft.Json.dll b/modules/swagger-codegen/src/main/resources/csharp/Newtonsoft.Json.dll deleted file mode 100644 index ae725c4b598..00000000000 Binary files a/modules/swagger-codegen/src/main/resources/csharp/Newtonsoft.Json.dll and /dev/null differ diff --git a/modules/swagger-codegen/src/main/resources/csharp/RestSharp.dll b/modules/swagger-codegen/src/main/resources/csharp/RestSharp.dll deleted file mode 100644 index a7331ed6e23..00000000000 Binary files a/modules/swagger-codegen/src/main/resources/csharp/RestSharp.dll and /dev/null differ