diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java index 52b64ebfd0c..aa776731e9c 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java @@ -45,7 +45,20 @@ public class CSharpClientCodegen extends DefaultCodegen implements CodegenConfig reservedWords = new HashSet( Arrays.asList( - "abstract", "as", "base", "bool", "break", "byte", "case", "catch", "char", "checked", "class", "const", "continue", "decimal", "default", "delegate", "do", "double", "else", "enum", "event", "explicit", "extern", "false", "finally", "fixed", "float", "for", "foreach", "goto", "if", "implicit", "in", "int", "interface", "internal", "is", "lock", "long", "namespace", "new", "null", "object", "operator", "out", "override", "params", "private", "protected", "public", "readonly", "ref", "return", "sbyte", "sealed", "short", "sizeof", "stackalloc", "static", "string", "struct", "switch", "this", "throw", "true", "try", "typeof", "uint", "ulong", "unchecked", "unsafe", "ushort", "using", "virtual", "void", "volatile", "while") + // local variable names in API methods (endpoints) + "path_", "pathParams", "queryParams", "headerParams", "formParams", "fileParams", + "postBody", "http_header_accepts", "http_header_accept", "apiKeyValue", "response", + "statusCode", + // C# reserved words + "abstract", "as", "base", "bool", "break", "byte", "case", "catch", "char", "checked", + "class", "const", "continue", "decimal", "default", "delegate", "do", "double", "else", + "enum", "event", "explicit", "extern", "false", "finally", "fixed", "float", "for", + "foreach", "goto", "if", "implicit", "in", "int", "interface", "internal", "is", "lock", + "long", "namespace", "new", "null", "object", "operator", "out", "override", "params", + "private", "protected", "public", "readonly", "ref", "return", "sbyte", "sealed", + "short", "sizeof", "stackalloc", "static", "string", "struct", "switch", "this", "throw", + "true", "try", "typeof", "uint", "ulong", "unchecked", "unsafe", "ushort", "using", + "virtual", "void", "volatile", "while") ); diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs index e7334aa160b..ba58eeac9e0 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs @@ -307,42 +307,6 @@ namespace IO.Swagger.Api /// Task of ApiResponse System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null); - /// - /// downloads an image - /// - /// - /// - /// - /// Stream - Stream DownloadFile (); - - /// - /// downloads an image - /// - /// - /// - /// - /// ApiResponse of Stream - ApiResponse DownloadFileWithHttpInfo (); - - /// - /// downloads an image - /// - /// - /// - /// - /// Task of Stream - System.Threading.Tasks.Task DownloadFileAsync (); - - /// - /// downloads an image - /// - /// - /// - /// - /// Task of ApiResponse (Stream) - System.Threading.Tasks.Task> DownloadFileAsyncWithHttpInfo (); - /// /// uploads an image /// @@ -1523,131 +1487,6 @@ namespace IO.Swagger.Api null); } - /// - /// downloads an image - /// - /// Stream - public Stream DownloadFile () - { - ApiResponse response = DownloadFileWithHttpInfo(); - return response.Data; - } - - /// - /// downloads an image - /// - /// ApiResponse of Stream - public ApiResponse< Stream > DownloadFileWithHttpInfo () - { - - - var path_ = "/pet/{petId}/downloadImage"; - - var pathParams = new Dictionary(); - var queryParams = new Dictionary(); - var headerParams = new Dictionary(Configuration.DefaultHeader); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - // to determine the Accept header - String[] http_header_accepts = new String[] { - "application/octet-stream" - }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - pathParams.Add("format", "json"); - - - - - - - - - // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); - - int statusCode = (int) response.StatusCode; - - if (statusCode >= 400) - throw new ApiException (statusCode, "Error calling DownloadFile: " + response.Content, response.Content); - else if (statusCode == 0) - throw new ApiException (statusCode, "Error calling DownloadFile: " + response.ErrorMessage, response.ErrorMessage); - - return new ApiResponse(statusCode, - response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (Stream) Configuration.ApiClient.Deserialize(response, typeof(Stream))); - - } - - /// - /// downloads an image - /// - /// Task of Stream - public async System.Threading.Tasks.Task DownloadFileAsync () - { - ApiResponse response = await DownloadFileAsyncWithHttpInfo(); - return response.Data; - - } - - /// - /// downloads an image - /// - /// Task of ApiResponse (Stream) - public async System.Threading.Tasks.Task> DownloadFileAsyncWithHttpInfo () - { - - - var path_ = "/pet/{petId}/downloadImage"; - - var pathParams = new Dictionary(); - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - // to determine the Accept header - String[] http_header_accepts = new String[] { - "application/octet-stream" - }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - pathParams.Add("format", "json"); - - - - - - - - - // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); - - int statusCode = (int) response.StatusCode; - - if (statusCode >= 400) - throw new ApiException (statusCode, "Error calling DownloadFile: " + response.Content, response.Content); - else if (statusCode == 0) - throw new ApiException (statusCode, "Error calling DownloadFile: " + response.ErrorMessage, response.ErrorMessage); - - return new ApiResponse(statusCode, - response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (Stream) Configuration.ApiClient.Deserialize(response, typeof(Stream))); - - } - /// /// uploads an image /// diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs index d9cb6b21005..6ad53e05257 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs @@ -14,7 +14,7 @@ namespace IO.Swagger.Model /// /// [DataContract] - public class Category : IEquatable + public class Category : IEquatable { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs index 2191707bd09..eb649ccf587 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs @@ -14,7 +14,7 @@ namespace IO.Swagger.Model /// /// [DataContract] - public class Order : IEquatable + public class Order : IEquatable { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs index 10c44fb46a7..202a171c219 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs @@ -14,7 +14,7 @@ namespace IO.Swagger.Model /// /// [DataContract] - public class Pet : IEquatable + public class Pet : IEquatable { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs index 93210505bf0..4aa4a9c97f0 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs @@ -14,7 +14,7 @@ namespace IO.Swagger.Model /// /// [DataContract] - public class Tag : IEquatable + public class Tag : IEquatable { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs index 1fbd17da993..5785a3d3509 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs @@ -14,7 +14,7 @@ namespace IO.Swagger.Model /// /// [DataContract] - public class User : IEquatable + public class User : IEquatable { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.userprefs b/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.userprefs index ab3a8ae3ac4..a5ad5d531bd 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.userprefs +++ b/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.userprefs @@ -2,9 +2,9 @@ - - - + + + diff --git a/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll b/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll index b0a59cff946..807ef197edf 100755 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll and b/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll differ diff --git a/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb b/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb index 25bc7b803d9..d4c01b5c42a 100644 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb and b/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb differ diff --git a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt index f115c595d6a..285fc683bfc 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt +++ b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt @@ -1,9 +1,9 @@ -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttribute.cs -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.swagger-logo.png -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll +/Users/williamcheng/Code/tmp/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttribute.cs +/Users/williamcheng/Code/tmp/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.swagger-logo.png +/Users/williamcheng/Code/tmp/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb +/Users/williamcheng/Code/tmp/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll +/Users/williamcheng/Code/tmp/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll +/Users/williamcheng/Code/tmp/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb +/Users/williamcheng/Code/tmp/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll +/Users/williamcheng/Code/tmp/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll +/Users/williamcheng/Code/tmp/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll diff --git a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll index b0a59cff946..807ef197edf 100755 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll and b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll differ diff --git a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb index 25bc7b803d9..d4c01b5c42a 100644 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb and b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb differ